Tuesday, April 1, 2014

Select values using multiple id’s in mysql


Let’s have a look how to select values using multiple id’s in where condition

Use IN keyword to perform this action

Definition of INkeyword:
                The IN keyword is used to specify multiple values in WHERE clause
 

SELECT * FROM mytable WHERE id IN (2,5,11);

mytable – Replace with your table name
id – Your auto increment id

1 comment: