Re: Помогите с запросом

From
Alex Gotlib (2:5080/1003)
To
andrew blinov
Date
2005-12-05T11:11:32Z
Area
SU.DBMS.SQL
From: Alex Gotlib <alex@cca.usart.ru>

           Hail there andrew!

    Sun, 04 Dec 2005 at 16:33 GMT andrew blinov wrote:

 ab> ID_SHOP SALES    ID_GOOD
 ab> 1       6        1
 ab> 2       4        4
 ab> 3       2        4
 ab> 
 ab> SELECT ID_SHOP, ID_GOODS, SUM(SALE_RES) as SALES
 ab>            FROM SALES GROUP BY ID_SHOP, ID_GOODS
 ab> 
 ab> А вот как теперь отсеять только максимальные по магазинам?

	ORDER BY SALES в конец запроса добавь.

-- 
     WBR, Alexander B. Gotlib,
     mailto:alex@cca.usart.ru / ICQ# 13043204.
-|-                                                                  -|-
--- ifmail v.2.15dev5
 * Origin: (http://news.cca.usart.ru/) USURT's FidoNET<-> (2:5080/1003@fidonet)
SEEN-BY: 46/50 50/12 278/169 452/25 154 2432/260 4615/21 4635/1024 5000/5000
SEEN-BY: 5001/100 5010/2 53 5011/13 5012/30 46 5015/10 28 5019/31 5020/545 715
SEEN-BY: 5020/760 1641 2020 2238 4441 5021/29 5025/3 5026/10 5027/16 5028/61
SEEN-BY: 5029/45 60 5030/115 5035/38 5036/34 44 5041/4 5042/21 5045/7 5047/43
SEEN-BY: 5049/19 5053/16 5054/1 8 9 28 35 37 45 50 63 67 5058/999 5059/9
SEEN-BY: 5069/7 5070/156 5071/22 5077/70 5078/20 5080/68 147 239 1003 5085/13
SEEN-BY: 5085/87 5093/4 5095/20 5097/31 64 6000/254 6028/1 6055/2 6083/12
PATH: 5080/1003 5020/545 5054/1 37