lead2gold Posted July 19, 2006 Share Posted July 19, 2006 Ok, i guess my brain isn't working...What am i doing wrong?[code]SELECT count( gid )FROM tableWHERE sid =1GROUP 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? Quote Link to comment Share on other sites More sharing options...
shoz Posted July 19, 2006 Share Posted July 19, 2006 [code]SELECTCOUNT(DISTINCT gid) AS numFROMtablenameWHEREsid = 1[/code] Quote Link to comment Share on other sites More sharing options...
lead2gold Posted July 19, 2006 Author Share Posted July 19, 2006 I'll give some grace for that!Thanks a million! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.