私信  •  关注

Sathvik Reddy

Sathvik Reddy 最近创建的主题
Sathvik Reddy 最近回复了
6 年前
回复了 Sathvik Reddy 创建的主题 » 在MySQL中选择具有多条件要求的行
select distinct(Cust_Fname),distinct(Cust_Lname),distinct(Cust_Street),distinct(Cust_City),distinct(Cust_State),distinct(Cust_ZIP) from lgcustomer as cust
   join (select inv_num,cust_code from lginvoice where CAST(inv_date AS DATE) between '2013-07-15' and '2013-07-31') inv on inv.cust_code = cust.cust_code
   join (select inv_num, prod_sku from lgline) ll on ll.inv_num = inv.inv_num
   join (select prod_sku,prod_descipt, brand_id from lgproduct where prod_descipt like "%Top Coat%") lgp on lgp.prod_sku = ll.prod_sku
   join (select brand_id, brand_name from lgbrand where brand_name like "%Foresters Best%") lb on lb.brand_id = lgp.brand_id
   order by 5,2,1 desc