MySQL returns the same result using the IN clause irrespective of the value used
Posted by: Deepthi Pullannagari
Date: July 15, 2015 11:07AM

The queries below returns the same row irrespective of the value given

select * from Test where Test_ID = (792718488739137399) ;

select * from Test where Test_ID = (792718488739137398) ;

select * from Test where Test_ID = (792718488739137397) ;

However when I enclose the values in single quotes like

select * from Test where Test_ID = ('792718488739137399') ;

Then I get the correct output as expected. The datatype for Test_ID is varchar . Could that be the reason why I need to enclose in single quotes ? Is it the default behaviour in Mysql ?

Options: ReplyQuote


Subject
Views
Written By
Posted
MySQL returns the same result using the IN clause irrespective of the value used
2227
July 15, 2015 11:07AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.