MYSQL -Incorrect Syntax

Posted by user1854392 on Stack Overflow See other posts from Stack Overflow or by user1854392
Published on 2012-12-02T22:43:23Z Indexed on 2012/12/02 23:03 UTC
Read the original article Hit count: 169

Filed under:
|
WHILE x > 1 DO
SET x = x - 1;    
SET totalTime =  SELECT CONCAT(FLOOR(HOUR(TIMEDIFF(end_time,start_time)) / 24), ' days ',

MOD(HOUR(TIMEDIFF(end_time,start_time)), 24), ' hrs ',

MINUTE(TIMEDIFF(end_time,start_time)), ' minutes ') AS total_Time

I don't see why I am having a syntax error?

It is part of a bigger procedure but is pointing to this aas being incorrect

Error message: SQL Error (1064): 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 CONCAT(FLOOR(HOUR(TIMEDIFF(end_time,start_time)) / 24,' days',' at line 11

and totalTime is declared as a VARCHAR(50)

© Stack Overflow or respective owner

Related posts about mysql

Related posts about stored-procedures