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;
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;