我需要将多个选择语句分组为一个查询和多个列
我已经尝试使用UNION,但这会导致我的选择项之一丢失(可能是滥用了它)
SELECT COUNT(*) AS EMERGENCIA FROM Incidentes WHERE Prioridad_Real = 'Emergencia' AND Estado = 'Resuelto a Tiempo'
AND Fecha_Asigna >= '2013-08-22 13:30:00.000' and Fecha_Resul <= '2013-08-23 11:16:00.000'
SELECT COUNT(*) AS ALTA FROM Incidentes WHERE Prioridad_Real = 'Alta' AND Estado = 'Resuelto a Tiempo'
AND Fecha_Asigna >= '2013-08-22 13:30:00.000' and Fecha_Resul <= '2013-08-23 11:16:00.000'
SELECT COUNT(*) AS MEDIA FROM Incidentes WHERE Prioridad_Real = 'Media' AND Estado = 'Resuelto a Tiempo'
AND Fecha_Asigna >= '2013-08-22 13:30:00.000' and Fecha_Resul <= '2013-08-23 11:16:00.000'
SELECT COUNT(*) AS BAJA FROM Incidentes WHERE Prioridad_Real = 'Baja' AND Estado = 'Resuelto a Tiempo'
AND Fecha_Asigna >= '2013-08-22 13:30:00.000' and Fecha_Resul <= '2013-08-23 11:16:00.000'
预期结果:
答案 0 :(得分:6)
尝试使用以下查询:
curl_slist_free_all(list);