
Query Oracle
Publicado por Moisés (5 intervenciones) el 24/08/2015 21:07:49
Hola a todos, tengo el siguiente query que Suma segun los filtros que le doy. Lo que no entiendo es por qué
no suma bien. Ejemplo:
Si debe Sumar 1800, me muestra 1950. Por favor su apoyo .
Vean la imagen:
http://subefotos.com/ver/?e2f60e013f...22d4527f0o.png
Espero su respuesta.
no suma bien. Ejemplo:
Si debe Sumar 1800, me muestra 1950. Por favor su apoyo .
1
2
3
4
5
6
7
8
SELECT ASSETNUM, TOTALCOST FROM ASSET
WHERE ASSETNUM LIKE 'H%' AND TOTALCOST!=0
GROUP BY ASSETNUM,TOTALCOST
HAVING SUM(TOTALCOST)>200
UNION
SELECT 'TOTAL',SUM(TOTALCOST) FROM ASSET
WHERE ASSETNUM LIKE 'H%' AND TOTALCOST!=0
HAVING SUM(TOTALCOST)>200;
Vean la imagen:
http://subefotos.com/ver/?e2f60e013f...22d4527f0o.png
Espero su respuesta.
Valora esta pregunta


0