coder9 Posted July 26, 2008 Share Posted July 26, 2008 ok I'm not sure if this is possible using single mysql query only. Let say i have 5 numbers. 9, 30, 40, 23 and 88 I want to search for these numbers from a table and show me who is the employee who own this number on each equivalent number. let say joseph = 9, john = 30, karen = 40, warren = 23 and george = 88. A BIG Thank you in advance. Quote Link to comment Share on other sites More sharing options...
Barand Posted July 26, 2008 Share Posted July 26, 2008 SELECT id, name FROM employee WHERE id IN (9, 30, 40, 23, 88) Quote Link to comment Share on other sites More sharing options...
rawb Posted July 26, 2008 Share Posted July 26, 2008 SELECT * FROM tablename WHERE (id='9' OR id='30' OR id='40' OR id='23' OR id='88') Should return what you need. Quote Link to comment Share on other sites More sharing options...
coder9 Posted July 26, 2008 Author Share Posted July 26, 2008 SELECT id, name FROM employee WHERE id IN (9, 30, 40, 23, 88) Thank you very much BARAND! I now understand why you hate immature people. practice, practice, practice, practice, practice, practice................................................................! Quote Link to comment Share on other sites More sharing options...
coder9 Posted July 26, 2008 Author Share Posted July 26, 2008 i already read this many times before but i always forgot, maybe that's because i'm always immature. lol Quote Link to comment 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.