Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Query question- Bringing back orders with more than 1 product.

Status
Not open for further replies.

txwylde

Programmer
Jan 25, 2001
60
US
I am trying to create a query that will pull back orders where there is more than one item in the list. I have tried to do a count on product_group and then tried doing a count on material_num but it still brings back the unique records. Here is my SQL.
Thanks!
Bill

select
order_date,
sales_order_num,
product_group,
ip_address,
avs_check,
cvm,
email,
fraud_review,
class_c_address,
substring(decode(card_num,"bourbon"),1,6) card
from risk.order_summary
where sales_org = "3400"
and sendto_city = "Scarborough"
and order_date >= " 2005-06-01"
and order_date <= "2005-08-03"
and substring(material_num,1,1) = "M"
and substring(product_group, 1, 4) = "IPOD"
group by sales_order_num;
 
which is the one-to-many relationship? which columns? which is the order and which is the item?

you're drawing only from one table, this means you want only some of the rows and not all of them, right?

r937.com | rudy.ca
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top