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 |
Christech82
Starting Member
20 Posts |
Posted - 2013-04-10 : 16:07:25
|
blank |
|
UnemployedInOz
Yak Posting Veteran
54 Posts |
Posted - 2013-04-10 : 21:27:43
|
Looks ok and will work but should be written likeSELECT MODEL, COUNT(SALES_NUM) FROM SHOE_MODEL JOIN SALES ON SHOE_MODEL.SHOE_MODEL_NO = SALES. SHOE_MO_NOGROUP BY MODEL |
|
|
bandi
Master Smack Fu Yak Hacker
2242 Posts |
Posted - 2013-04-11 : 01:12:00
|
>>the most brand new model shoes that got the maximal number of salesSELECT TOP 1 WITH TIES MODEL, COUNT(SALES_NUM) MaxSalesFROM SHOE_MODEL JOIN SALESON SHOE_MODEL.SHOE_MODEL_NO = SALES. SHOE_MO_NOGROUP BY MODELORDER BY MaxSales DESC |
|
|
Christech82
Starting Member
20 Posts |
Posted - 2013-04-11 : 15:53:58
|
quote: Originally posted by UnemployedInOz Looks ok and will work but should be written likeSELECT MODEL, COUNT(SALES_NUM) FROM SHOE_MODEL JOIN SALES ON SHOE_MODEL.SHOE_MODEL_NO = SALES. SHOE_MO_NOGROUP BY MODEL
It is working in both waysThank you for replying ... |
|
|
|
|
|