Click here to Skip to main content
15,891,136 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
how to get unique 5 rows in SELECT QUERY (mysql)
it is my table
id name
1 test5
2 test1
3 test2
4 test3
5 test4
6 test6

i want to fetch my data in php where id=1,2,4,6,3


please help me........
Posted

1 solution

use in clause for filter for multiple ids
use distinct for unique records(rows)
SQL
Select distinct * from tablename 
where id in (1,2,4,6,3)

Happy Coding!
:)
 
Share this answer
 
Comments
kailash panigrahi 29-May-13 4:58am    
Thanks for your solution......
Aarti Meswania 29-May-13 4:59am    
Welcome!
Glad to help you! :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900