SELECT * FROM ( SELECT C1-C2 AS A1 FROM TT) A WHERE A1>0
select t.product_number,t.product_number_noc,count(*) as quantity,round(count(*)*1.3) as goumai,s.product_quantity,round(count(*)*1.3)-s.product_quantity as sult from tworder_products t,products_stock s where t.import_date in (select distinct(import_date) from(select distinct(import_date) from tworder_products order by import_date desc LIMIT 9) as result) and t.product_number != '' and t.product_number_noc = s.product_sku group by t.product_number其实我的整个sql是这样的
select t.product_number,t.product_number_noc,count(*) as quantity,round(count(*)*1.3) as goumai,s.product_quantity,round(count(*)*1.3)-s.product_quantity as sult from tworder_products t,products_stock s where t.import_date in (select distinct(import_date) from(select distinct(import_date) from tworder_products order by import_date desc LIMIT 9) as result) and t.product_number != '' and t.product_number_noc = s.product_sku group by t.product_number其实我的整个sql是这样的,我要sult的 取大于0的所有行我在下面加个and sult > 0 不能识别sult,求高手解决
SELECT C1-C2 AS A1 FROM TT) A
WHERE A1>0
from tworder_products t,products_stock s where t.import_date in
(select distinct(import_date) from(select distinct(import_date) from tworder_products order by import_date desc LIMIT 9) as result)
and t.product_number != ''
and t.product_number_noc = s.product_sku
group by t.product_number其实我的整个sql是这样的
from tworder_products t,products_stock s where t.import_date in
(select distinct(import_date) from(select distinct(import_date) from tworder_products order by import_date desc LIMIT 9) as result)
and t.product_number != ''
and t.product_number_noc = s.product_sku
group by t.product_number其实我的整个sql是这样的,我要sult的 取大于0的所有行我在下面加个and sult > 0 不能识别sult,求高手解决
from A
WHERE A.b>0;