List:General Discussion« Previous MessageNext Message »
From:Martin Ramsch Date:September 28 1999 2:10pm
Subject:Re: Relational database SELECT
View as plain text  
On Tue, 1999-09-28 13:20:07 +0200, Erik Andersson wrote:
> mysql> SELECT
>     ->     product.product_info AS Product,
>     ->     product.product_price AS Price,
>     ->     SUM(orderrow.orderrow_quantity) AS Quantity,
>     ->     SUM(product.product_price*orderrow.orderrow_quantity) AS 'Total cost'
>     -> FROM
>     ->     product,
>     ->     customer,
>     ->     orderrow
>     -> WHERE
>     ->     product.product_id=orderrow.product_id
>     -> AND
>     ->     orderrow.customer_id=customer.customer_id
>     -> AND
>     ->     customer.customer_login='nobody'
>     -> GROUP BY
>     ->     product.product_info;

Looks fine!

Regards,
  Martin
-- 
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
Thread
Relational database SELECTErik Andersson28 Sep
  • Re: Relational database SELECTMartin Ramsch28 Sep