On Fr, 1999-03-12 16:54:42 +0100, Harry Brückner wrote:
> Now I want to select each article just once, where it has the amount
> is the maximum.
What you need is "GROUP BY", because you group all rows with the same
Shop and Articles together and then sum up the Amount inside each group:
SELECT Shop, Article, sum(Amount)
GROUP BY Shop, Article;
> PS: Does anyone know a good SQL book which helps to get those little harder
> SQL questions answered. Something like a "SQL Cookbook" or something ?
The only (quote good) one I know about is:
SQL Tutorial by James Hoffman
<URL: http://www.geocities.com/ResearchTriangle/Node/9672/sqltut.html >
Martin Ramsch <m.ramsch@stripped> <URL: http://home.pages.de/~ramsch/ >
PGP KeyID=0xE8EF4F75 FiPr=52 44 5E F3 B0 B1 38 26 E4 EC 80 58 7B 31 3A D7