select '銷售' as 'Typed', SH_number,SH_type,SH_brand,SH_colour,SH_Size,SH_amount_tmp as 'sla',SH_Sale,SH_Shopname,SH_Generation_date from sh_sales_record_list
union all
select '退貨' as 'Typed', SH_number,SH_type,SH_brand,SH_colour,SH_Size,SH_amount as 'sla',SH_Sale,SH_Shopname,SH_Generation_date from sh_sales_return_record_list
UNION ALL
SELECT '合計' as 'Typed','','','','','',SUM(sla),SUM(SH_Sale),'','' from sh_sales_record_list
[SQL]select '銷售' as 'Typed', SH_number,SH_type,SH_brand,SH_colour,SH_Size,SH_amount_tmp as 'sla',SH_Sale,SH_Shopname,SH_Generation_date from sh_sales_record_list
union all
select '退貨' as 'Typed', SH_number,SH_type,SH_brand,SH_colour,SH_Size,SH_amount as 'sla',SH_Sale,SH_Shopname,SH_Generation_date from sh_sales_return_record_list
UNION ALL
SELECT '合計' as 'Typed','','','','','',SUM(sla),SUM(SH_Sale),'','' from sh_sales_record_list
[Err] 1054 - Unknown column 'sla' in 'field list'
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/113841.html
標籤:MySQL
上一篇:mysql中間件的一個問題
