MySQL Forums
Forum List  »  Portuguese

erro ao tentar executar dois select seguidos
Posted by: agamoto m
Date: July 08, 2009 01:34PM

Olá pessoal,

Estou com um problema que não consigo perceber.

Estou a ter um erro quando executo a query seguinte dentro do meu código e no mysql browser:

DELIMITER $$
SELECT COUNT(*) INTO @A
FROM lead2.INDICADOR;

SELECT (COUNT(*) *100)/@A
FROM lead2.INDICADOR I
WHERE DATA_ULTIM_IMPORT > NOW() - INTERVAL 1 MONTH;

ERRO: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SELECT (COUNT(*) *100)/@A
FROM lead2.INDICADOR I
WHERE DATA_ULTIM_IMPORT > NOW' at line 3

Mas no meu phpMyAdmin ela é executada sem problemas.

Alguém sabe o que possa ser?

Obrigado.
Erro:



Edited 1 time(s). Last edit at 07/08/2009 01:35PM by agamoto m.

Options: ReplyQuote


Subject
Views
Written By
Posted
erro ao tentar executar dois select seguidos
6827
July 08, 2009 01:34PM


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.