0
我有这个疑问的报告:MySQL的GROUP BY - UNION ALL
select @t := '' as 'Clave', @tf:='Inventario Físico' as 'Descripción', @t:= '' as 'Cantidad', @t:= '' as 'Precio Unitario' union all
select @t:= '', @t:= '', @t:= '', @t:= '' union all
(select cla, des, can, CAST(pl1*can as Decimal(10,2)) from inventario order by cla) union all
select @t:= '', @t:='', @tnde := 'Número de Elementos: ', count(*) from inventario union all
select @t:= '', @t:= '', @tne:= 'Suma total: $', sum(ppu) from inventario;
我需要一个 “排序依据” 为第三查询。
select cla, des, can, CAST(pl1*can as Decimal(10,2)) from inventario order by cla
就其本身而言,该代码行完美工作,但是,当它在工会之间时,所有信息都没有排序。我该如何解决这个问题?谢谢。