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.
| Author |
Topic |
|
real_pearl
Posting Yak Master
106 Posts |
Posted - 2004-06-18 : 05:25:07
|
| If a table A hasClassID SectionID5th A5th B5th C6th A6th B6th CSELECT ClassID, COUNT(ClassID) FROM Class_SectionGROUP BY ClassIDit will return 5th 36th 3There are two classes, how can we get the information telling there is ony one class if only 5th exists even though it contains 10, 20 rows. But the query may return 1 if only 5th exists and if 6th also exists then query return 2 and so on. Please tell me what query should I write to get this information? |
|
|
ditch
Master Smack Fu Yak Hacker
1466 Posts |
Posted - 2004-06-18 : 05:38:40
|
| select count(distinct ClassID)from Class_SectionDuane. |
 |
|
|
real_pearl
Posting Yak Master
106 Posts |
Posted - 2004-06-18 : 06:21:47
|
Thanks a lot |
 |
|
|
|
|
|