Reputation: 37
The following mysql query result returns 'TRUE'
,
select if('testString' in ( 0 ), 'TRUE', 'FALSE') from sampleTable
Can someone explain why please ?
Upvotes: 1
Views: 157
Reputation: 133360
You can try using
select cast('testString' AS UNSIGNED) from dual ; // return 0
do the fact because the cast for 'testString' AS UNSIGNED is = 0
then
select if( 'testString' in ( 0 ), 'TRUE', 'FALSE') from DUAL ;
match for casted value the 0 in (0) and return TRUE
Upvotes: 1