cs.punk Posted December 28, 2012 Share Posted December 28, 2012 (edited) SELECT * FROM items WHERE id = 1 OR id = 1 OR id = 1 How can I have this return 3 (the number of OR clauses) records regardless if there are duplicates? Edited December 28, 2012 by cs.punk Quote Link to comment https://forums.phpfreaks.com/topic/272444-select-records-even-if-duplicates-using-where-clause/ Share on other sites More sharing options...
Barand Posted December 28, 2012 Share Posted December 28, 2012 I think you will have to use a UNION SELECT * FROM items WHERE id = 1 UNION ALL SELECT * FROM items WHERE id = 1 UNION ALL SELECT * FROM items WHERE id = 1 Quote Link to comment https://forums.phpfreaks.com/topic/272444-select-records-even-if-duplicates-using-where-clause/#findComment-1401775 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.