subquery - join using in mysql
Wednesday, April 23rd, 2008SELECT sports_name
FROM sports
WHERE id
IN (
SELECT sports_id
FROM sports_key
WHERE user_id =1
)
In this query we have selected field(sports_id) from the table(sports_key) and also we checed the field(user_id) This process has been done in subquery. Then finally, we have selected field (sports_name) from the table (sports_key) according to receiving field (id) values from subquery.
Posted by