Is it possible to select individual rows within a table from a list of one column variables?
e.g. I’m trying to select just certain products from a table of products, using a list of ID numbers
Example table “items”:
item_id item_title item_source
------- ---------- -----------
123 item A place_a
124 item B place_b
125 item C place_c
126 item D place_d
Here’s what I’m trying, but it’s not working:
select item_title, item_source from items where item_id IN ('123','125','126')
I want to return:
item A place_a
item C place_c
item D place_d
just get rid of the quotes (assuming your field
item_idis an integer)select item_title, item_source from items where item_id IN (123,125,126)