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
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)

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.