[firebase-br] sql com union all
Henery Linck Rosenhaim
henery em multi-informatica.com.br
Qui Ago 25 14:42:52 -03 2005
Eu preciso fazer essa consulta funcionar... o banco é firebird 1.5.2
o erro que me apresenta é esse... já tentei de tudo, .. mas nada
funciona... por favor, se alguem puder ajudar.. é urgente....
Invalid token.
Dynamic SQL Error.
SQL error code = -104.
Invalid command.
invalid ORDER BY clause.
SELECT EXTRACT(MONTH FROM CABEC.DEN_LEC) AS MES,
CAST('ENTRADA' AS CHAR(7)) AS MOVIMENTO,
CABEC.VAL_LEC AS VALCONT,
CONFNAT.DCA_CNL AS DESPRESAR,
CAST('P' AS CHAR(1)) AS TIPO,
(REF_LEC) AS LANC
FROM TBLEC CABEC LEFT JOIN
TBCNL CONFNAT ON (CABEC.NAT_LEC = CONFNAT.NAT_CNL)
WHERE ( EXTRACT(YEAR FROM CABEC.DEN_LEC) = 2005 )
UNION ALL
SELECT EXTRACT(MONTH FROM CABEC.DEM_LSC) AS MES,
CAST('SAIDA' AS CHAR(7)) AS MOVIMENTO,
CABEC.VAL_LSC AS VALCONT,
CONFNAT.DCA_CNL AS DESPRESAR,
CAST('P' AS CHAR(1)) AS TIPO,
(REF_LSC) AS LANC
FROM TBLSC CABEC LEFT JOIN
TBCNL CONFNAT ON (CABEC.NAT_LSC = CONFNAT.NAT_CNL)
WHERE ( CAN_LSC <> 'S' ) and
( EXTRACT(YEAR FROM CABEC.DEM_LSC) = 2005 )
ORDER BY MES
Mais detalhes sobre a lista de discussão lista