SQL Query in another SQL Query SQL Subquery
SQL Query in another SQL Query SQL Subquery
You might have wanted to do a SQL query inside an another SQL query. You can do this using SQL Subquery. Its simple as ABC. Heres an example :
As you can see its very simple. Heres another example :
Enjoy !!!
SELECT * FROM `fdposts` WHERE user IN (SELECT friend FROM `fdfriends` WHERE user=subins2000)The above code will select rows in table fdposts where user is the value of friend row in the table fdfriends.
As you can see its very simple. Heres another example :
SELECT * FROM `posts` WHERE user IN (SELECT name FROM `members` WHERE user=subins2000)The above code will select rows in table posts where user is the value of the row name in the table members.
Enjoy !!!
download file now
Comments
Post a Comment