MySQL Forums
Forum List  »  Portuguese

Dúvida com UNION
Posted by: ffs ffs
Date: October 13, 2008 07:33AM

Pessoal,

Estou tentando executar a seguinte query:

SELECT Sum(val) as 'ValoresEmReais'
FROM dados
WHERE param1 = 'R$'
UNION
(SELECT Sum(val) as 'ValoresEmDolar'
FROM dados
WHERE param1 = '$';

onde "val" e "param1" são atributos de uma tabela. No entanto o seguinte erro está ocorrendo:

[Error Code: 1064, SQL State: 42000] You have an error in your SQL syntax near 'UNION

Valeu
Fúlvio

Options: ReplyQuote


Subject
Views
Written By
Posted
Dúvida com UNION
7419
October 13, 2008 07:33AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.