mysql if condition in select queryI needto use mysql if condition in select query like following :
select if(mycol,'ok','no') from mytable where id =12;
The mycol value is either 0 or 1. But when I use this I am always getting the value 'ok'. .
I needto get the result as 'ok' when mycol value is 1 and 'no' when it is 0.
edited on 9/6/12