Return to Snippet

Revision: 54643
at January 7, 2012 02:09 by the_construct


Updated Code
--- 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)

Revision: 54642
at January 7, 2012 02:03 by the_construct


Updated Code
--- 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
SELECT * FROM `your_table_name` WHERE some_id IN(1165,1166,1180,1181)

Revision: 54641
at January 7, 2012 02:02 by the_construct


Updated Code
--- 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
SELECT * FROM `your_table_name` WHERE some_id IN(1165,1166,1180,1181)

Revision: 54640
at January 5, 2012 21:42 by the_construct


Initial Code
--- YOU WANT TO SELECT MULTIPLE ROWS AT ONCE BASED ON UNIQUE VALUES
SELECT * FROM `your_table_name` WHERE some_id IN(1165,1166,1180,1181)

Initial URL

                                

Initial Description
Where clause to select multiple rows of unique values

Initial Title
Where clause to select multiple rows of unique values

Initial Tags
mysql, sql

Initial Language
SQL