/ Published in: SQL
Where clause to select multiple rows of unique values
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
--- YOU WANT TO SELECT MULTIPLE ROWS AT ONCE BASED ON UNIQUE VALUES --- some_id IS THE COLUMN NAME THAT MAY HAVE AN ID THAT YOU WANT TO BASE THE SELECTION ON --- IN PLAIN ENGLISH YOU ARE SAYING... --- SELECT ALL THE ID'S (IN PARENTHESES) FROM THE COLUMN NAMED some_id SELECT * FROM `your_table_name` WHERE some_id IN(1165,1166,1180,1181)