Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Selecting a count of unique id's

Author  Topic 

Cyclonik
Posting Yak Master

114 Posts

Posted - 2001-05-17 : 16:27:15
I thought this was simple when someone asked me to do it( maybe it is) but what i am trying to do is select a count of all the id's that occur only once in the table. i figured i could do this on one select statement..so far no luck

this might give you and idea although this obviously doesn't work

select ticket_id from wms_calls where (select ticket_id,count(ticket_id) from wms_calls group by ticket_id) = 1

i am thinking i dump the sub query into a temp table then select only that which has a count of 1
Thanks
Christian

-=:SpasmatiK:=-

Edited by - Cyclonik on 05/17/2001 16:44:45
   

- Advertisement -