I know this is an off topic question, but wondered if anyone might have a moment to help. I wouldn't ask if I could do a sub-select...
I am using mysql v3.23.51 and have a table I need to display the information of users who are working in both category 3 and category 5. Table def looks kind of like: lookuptable { id int, user int, category int, status tinyint, ... .. } A query I am using is kind of like the following: select B.name,C.name from lookuptable A, user B, cat C where A.user = B.id and A.category = C.id and A.category in (3,5); The problem I see is that records come back where a user is in category 3 or category 5. How do I limit records so that the selected user must have category entries for both 3 and 5? (not in the same entry of course) Thanks for your time, -Craig --------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php