I've got a multi-table query, (pulling from both an orders and an orders_products 
(line items) file), and I'd like to group the output to help reduce multiple 
appearances of of the product skus.

The query:

select 
orders.orders_id,orders.date_purchased,orders.customers_name,orders_products.products_name,orders_products.products_model,orders_products.products_quantity,
 orders_products.products_price from orders,orders_products where 
orders.date_purchased='2003-01-01' and orders.orders_id=orders_products.orders_id 
order by orders_products.products_model

You get output like 

Order Num               Order Date              Product Code            Product Name
---------------------------------------------------------------------------------------
1                       2003-01-01              12345                   product xyz
2                       2003-01-01              12345                   product xyz
3                       2003-01-01              abcde                   product abc
1                       2003-01-01              abcde                   product abc
5                       2003-01-01              12345                   product xyz

If I wanted to have the output grouped on any of the fields, how would I go about 
doing it?

TIA

Kelly


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to