Пример SQL
| O_Id | OrderDate | OrderPrice | Customer |
|---|---|---|---|
| 1 | 2008/11/12 | 1000 | Hansen |
| 2 | 2008/10/23 | 1600 | Nilsen |
| 3 | 2008/09/02 | 700 | Hansen |
| 4 | 2008/09/03 | 300 | Hansen |
| 5 | 2008/08/30 | 2000 | Jensen |
| 6 | 2008/10/04 | 100 | Nilsen |
Query Result:
| Customer | |
|---|---|
| Nilsen | 1700 |
Query Result:
| Customer | |
|---|---|
| Hansen | 2000 |
| Jensen | 2000 |






Comments
SELECT Customer,SUM(Or derPrice) FROM Orders - (Orders) and you call the table "Persons"!!!
the fool Quote
and displays a line with the amount in 1700 (Nilsen).
In the table itself and not close to that amount.
As it appeared, or calculate?
As for me, it should print 5 lines, with the exception of the row in which the sum of exactly 2000.
Or am I wrong?
Then explain. Quote
WHERE YEAR (DATE) = 1996
What is this?? write competently Quote
believe SUM (OrderPrice) Ie sum (OrderPrice) for each Customer'a.
We have two entries for Nilsen: 1600 and 100. SUM (OrderPrice) =1700 Quote