Home > mysql > Subqueries

Subqueries

Today was the first time I came across the need for SELECT’s within SELECT in mysql. Actually never done much of non-trivial coding in mysql! Also i came up with the most-probable syntax of such a thing if it existed. Then I immediately asked a friend and he said it exists and very much the same syntax(kind of obvious) He said its called nested queries rather subqueries and then i discovered that the early need for such nested loops was to make the language more intuitive and less confusing and hence the name “Structured Query Language” (SQL). Just imagine if you have 10 tables and u have one single connector in two consecutive tables, and suppose you need information from tb10 using tb1 info; it would be a really bad way of coding by writing 10 separate queries and pipe the outputs at ecery single stage but instead use a lot more better way by writing just one query and go ahead..Smart and obvious!

Advertisements
Categories: mysql Tags:
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: