开发者

How many times you can write Select Inside Select query in Mysql?

When I was st开发者_StackOverflow社区udying MySQL I have been asked by my Teacher to find out that how many times we can write Select query inside Select query

At that time I found the answer practically.


In theory it should be infinite, nested queries are allowed at multiple levels. In reality, you are limited by memory and hopefully common sense.


select in a select is really slow and shouldn't be used, unless there is no other alternative.

Try using joins to solve your problem, they work 90% of the time where you want to use a select in an other select...


A subquery can be nested inside the WHERE or HAVING clause of an outer SELECT, INSERT, UPDATE, or DELETE statement, or inside another subquery. Up to 32 levels of nesting is possible, although the limit varies based on available memory and the complexity of other expressions in the query. Individual queries may not support nesting up to 32 levels. A subquery can appear anywhere an expression can be used, if it returns a single value.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜