Jump to content

Simple count query - just can't do it


lead2gold

Recommended Posts

Ok, i guess my brain isn't working...
What am i doing wrong?
[code]
SELECT count( gid )
FROM table
WHERE sid =1
GROUP BY gid
[/code]
the above returns 2.

I currently have 2 entries in the entire database (to make testing easy).
What i want to have returned is 1 because both entries have the same gid.

How do i manipulate the above to acomplish this?
Link to comment
https://forums.phpfreaks.com/topic/15062-simple-count-query-just-cant-do-it/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.