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 :
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

Popular posts from this blog

Spider Man Friend Or Foe ISO Free Download PPSSPP Setting

Sorry Mutter closed unexpectedly on Ubuntu 10 10

Solution Ubuntu 10 04 minimize maximize and close button to right