Jump to content

syntax error with SQL Math


Shadowing

Recommended Posts

Hey guys getting hit with a error that i cant figure out

#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 'AS result' at line 6

 

 

SELECT (400 + ((2 - 1) * 600)) + ((400 + ((4 - 1) * 600)) - (400  + ((2 - 1) * 600)) * 

(1 - (((1343715769  - 1343715694) - (1343715814 - 1343715694)) / (1343715769 - 1343715694))) - 

(CEIL((400 + ((2 - 1) * 600)) + ((400  + ((4 - 1) * 600)) - (400 + 
((2 - 1) * 600))) / 600)) AS result

Link to comment
https://forums.phpfreaks.com/topic/266482-syntax-error-with-sql-math/
Share on other sites

one more ) before AS result

SELECT (400 + ((2 - 1) * 600)) + ((400 + ((4 - 1) * 600)) - (400  + ((2 - 1) * 600)) *   (1 - (((1343715769  - 1343715694) - (1343715814 - 1343715694)) / (1343715769 - 1343715694))) -   (CEIL((400 + ((2 - 1) * 600)) + ((400  + ((4 - 1) * 600)) - (400 +  ((2 - 1) * 600))) / 600))) AS result;
+----------+
| result   |
+----------+
| 598.0000 |
+----------+
1 row in set (0.00 sec)

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.