I have table named collections in which there are fields pk_collectionid and name.
I am generating a string containing the collection ids separated by commas. Format is : 1,1
I want to retrieve the name of all the ids mentioned in the string from collections table.
I have used IN clause under mysql.
My query is:
SELECT name
FROM `collections`
WHERE `pk_collectionid`
IN ( 1, 1 )
Right now it is generating one row as id is common but i want that it should show two rows instead of one even if ids are same.
This is a very strange requirement. The only solution I could think of is to use a
UNION ALLquery: