Home > database >  MYSQL aggregate problem, a great god help,
MYSQL aggregate problem, a great god help,

Time:10-06

Select the 'sales' 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 'return' 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 the 'total' as' Typed ', ' ', ' ' ' ' ' ', ', the SUM (sla), SUM (SH_Sale), ' ', 'the from sh_sales_record_list



Select [SQL] 'sales' 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 'return' 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 the 'total' as' Typed ', ' ', ' ' ' ' ' ', ', the SUM (sla), SUM (SH_Sale), ' ', 'the from sh_sales_record_list


(Err), 1054 - Unknown column 'sla' in 'the field list'