Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

So it seems this does the same thing as putting the subquery in the list of columns to return, except more efficient.

i.e.

   SELECT a, (SELECT b FROM ...) b FROM ....


Kind of.. it's more expensive than a direct join, but you can do more with it. AFAIK it's syntactic sugar around a correlated sub-query... It may be slightly more efficient now too. It should probably be used sparingly and over limited result sets.


I think it goes beyond syntax sugar, but perhaps there's a transformation between them that I'm not aware of.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: