Categories
How to display all query values?
It is required to display all the values of this request, but the problem is that id=7 will be displayed only once (instead of three, as in the request).
SELECT name FROM `table1` WHERE id IN(4,5,6,7,7,7);
Answer the question
In order to leave comments, you need to log in
SELECT a.name FROM table1 a, ( SELECT 4 id UNION ALL SELECT 5 UNION ALL SELECT 6 UNION ALL SELECT 7 UNION ALL SELECT 7 UNION ALL SELECT 7 ) b WHERE a.id = b.id;
Didn't find what you were looking for?
Ask a Question
731 491 924 answers to any question