Quantcast
Channel: No advantage of using Cross Apply or CTE over inline sub-query - Database Administrators Stack Exchange
Browsing all 4 articles
Browse latest View live

Answer by Paul White for No advantage of using Cross Apply or CTE over inline...

But the execution plan for both is same as shown below:The plans are different. One is an inner join, the other is an outer join. The results may be the same in your simple test, but the semantics are...

View Article


Answer by Emacs User for No advantage of using Cross Apply or CTE over inline...

My dilemma is about utility and advantages of using CROSS APPLY and CTE. Are there any or its just exotic? For small datasets the optimizer is probably not bothering with extensive analysis. However,...

View Article

Answer by JamieD77 for No advantage of using Cross Apply or CTE over inline...

What if you do SELECT i.Name COUNT(o.OrderId) cFROM Items i JOIN Orders o ON i.ItemID = o.ItemIDGROUP BY i.ItemIDcte and apply has it's advantages in some cases i'm sure, just probably not simple cases...

View Article

Image may be NSFW.
Clik here to view.

No advantage of using Cross Apply or CTE over inline sub-query

I came across a query like this:SELECT (SELECT COUNT(1) FROM Orders o WHERE i.ItemId = o.ItemId) [C]FROM Items iI changed it to following;WITH cte_countAS( SELECT COUNT(1) c, OrderId FROM Orders Group...

View Article
Browsing all 4 articles
Browse latest View live