Torna al Thread

UNION ALL SELECT tutto2.id_cliente, SUM(tutto2.inverno2) AS totale_inverno2, SUM(tutto2.estate2) AS totale_estate2, tutto2.anno FROM (SELECT id_cliente, totale AS inverno2, 0 AS estate2, anno FROM tab_ordine WHERE inverno = true AND anno = '2008' UNION ALL SELECT id_cliente, 0, totale, anno FROM tab_ordine WHERE estate = true AND anno = '2008' ) AS tutto2 GROUP BY id_cliente, anno;
Copyright © dotNetHell.it 2002-2024
Running on Windows Server 2008 R2 Standard, SQL Server 2012 & ASP.NET 3.5