sql - Mysql 5.5 IF statement -


Using MySQL 5.5 is trying to use IF statement:

  Mysql & gt; Select IF (1 = 1, 'OK', 'no') from my_table; Error 1064 (42000): There is an error in your SQL syntax; Use IY (1 = 1, 'OK', 'No') to line my_table on line 1, check the manual that matches your MySQL server version for the correct syntax?   

Mysql query has the correct syntax for :

 Select  if other (if condition, 'some results if true', 'some results are wrong'), other tablets ... where ...  

so that you use

  Description of selection, if I_ (1 = 1, 'OK', 'no') my_table;  

Comments

Popular posts from this blog

sqlite3 - UPDATE a table from the SELECT of another one -

c# - Showing a SelectedItem's Property -

javascript - Render HTML after each iteration in loop -