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 |
ddeme
Starting Member
3 Posts |
Posted - 2014-01-22 : 16:04:20
|
This is my data which had two tables album(asin, title, artist, price, release, label, rank)track(album, dsk, posn, song)This is my questionWagner's Ring cycle has an imposing 173 tracks, Bing Crosby clocks up 101 tracks.List albums so that the album with the most tracks is first. Show the title and the number of tracks |
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2014-01-22 : 16:28:20
|
Show us what you have tried so far as this is obviously a homework question. We will help with homework but won't do your homework for you.Tara KizerSQL Server MVP since 2007http://weblogs.sqlteam.com/tarad/ |
 |
|
ddeme
Starting Member
3 Posts |
Posted - 2014-01-22 : 16:45:19
|
SELECT title, count(asin) FROM album join track on (asin=album)ORDER BY count(*) DESCthis is how i tried and the result is i am getting the total counttitle count(asin)The Very Best Of Elvis Costello And The Attraction 3267 |
 |
|
Lamprey
Master Smack Fu Yak Hacker
4614 Posts |
Posted - 2014-01-22 : 18:12:20
|
You need a GROUP BY clause. |
 |
|
ddeme
Starting Member
3 Posts |
Posted - 2014-01-23 : 23:24:22
|
thank you got the result.....:) |
 |
|
|
|
|