Archive

Archive for December, 2008

Subqueries

December 29, 2008 Leave a comment

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:
%d bloggers like this: