Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4325238
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T09:14:23+00:00 2026-05-21T09:14:23+00:00

i dont exactly know how write down this query, so im asking your guys

  • 0

i dont exactly know how write down this query,
so im asking your guys and gals help.

so, i have a table the contains something like:

COLUMNS
id,keyword,pages

what i basicly need is to get all the rows where pages!=count(keyword)
this is basicly how i tried to do it anyway.

so it should be really simple, return all rows, where the keyword count does not equal the pages column value.

so, if for example the data is like this :

ROW A: 1, aaa, 3
ROW B: 4, aaa, 3
ROW C: 5, aaa, 3
ROW D: 5, aac, 100

with an example as above,
only ROW D will be returned since rows a,b,c PAGES (3) match the keyword count.

any help will welcome.
thx!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T09:14:24+00:00Added an answer on May 21, 2026 at 9:14 am

    A solution without a subquery. This will work filne in Mysql, but for more strict SQL’s you need to add some aggregate functios.

    SELECT a.*
    FROM mytable AS a
        LEFT JOIN mytable AS b
            ON b.keyword = a.keyword
    GROUP BY a.id
    HAVING COUNT(b.id) != a.pages
    

    Also use indexes like these:

    CREATE INDEX myindex ON mytable (keyword);
    CREATE INDEX myindex2 ON mytable (pages);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've come across the phrase 'sustaining software engineering' but don't know exactly what it
I dont know if I should use the httpcontext caching or the Enterprise Library
I dont find any usefull website according to this API. What's the format of
I dont know if I'm right, but allmost everytime I read about obfuscation and
Im new to programming and I dont know very much about but I'm making
Some people want to see the DB structure and dont have VS, is there
This code works, but i dont understand why. With DeferredLoadingEnabld = false, I would
Do Pagemethods and Json have security risks?(I dont use cookies).Forexample i have a pagemethod
Ive decided that I really dont like microsoft and their ways. Please could you
I am building stats for my users and dont wish the visits from bots

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.