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 |
|
petit16
Starting Member
1 Post |
Posted - 2011-01-09 : 11:10:33
|
| Hi i need some help with this query i've got 2 tables about MUSIC-SONGS-ARTIST-CDMUSICso i need to see the CD with the max number of songs i arrive at this point, as you can see i've got every CD with the numer of songs but not the only one which has the max number of songsSELECT CodDisco,COUNT(*) as Total from SONGSgroup by CodDisco Thank you |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2011-01-09 : 12:51:58
|
| [code]SELECT TOP 1 CodDisco,COUNT(*) as Total from SONGSgroup by CodDiscoORDER BY Total DESC[/code]------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
|
|
|