Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
Database Servers
DB2InformixIngresMS SQLOraclePervasive.SQLPostgreSQLProgressSybase
Desktop Databases
FileMakerFoxProMS AccessParadox
General
General DB TopicsDatabase Theory
Related Topics
Java Development.NET DevelopmentVB DevelopmentMore Topics ...

Database Forum / General DB Topics / General DB Topics / May 2004

Tip: Looking for answers? Try searching our database.

Select count on multiple columns

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Michael - 25 May 2004 20:34 GMT
I have a table with the following columns:

lid      subject id
period   period for sample i.e. day 1, day 30
labdt    date
sample   sample type

there also others, but they are not relevant

For each combination of these fields, there should be 20 rows similiar
to the following; there are 20 different samples:

lid    period   labdt       sample
0001   day 1    01/01/2001  glucose
0001   day 1    01/01/2001  sodium

i need a query that will show me any combination of the above that
does not have exactly 20 rows, ie the combination of lid, period and
labdt is >20 or <20
Gert van der Kooij - 25 May 2004 21:08 GMT
> I have a table with the following columns:
>
[quoted text clipped - 15 lines]
> does not have exactly 20 rows, ie the combination of lid, period and
> labdt is >20 or <20

select lid, period, labdt, count(*)
from table
group by lid, period, labdt
having count(*) <> 20
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.