Subject Re: [firebird-support] Non-correlated subquery is really slow
Author PenWin
Dne 18.2.2011 10:46, PenWin napsal(a):
> Dne 18.2.2011 10:33, kokok_kokok napsal(a):
>> How can I rewrite a non-correlated subquery to improve the performance?
>>
>> For example:
>>
>> SELECT
>> (SELECT COUNT(*) FROM Orders) AS TotalOrders,
>> Name
>> FROM Customers
>
> SELECT c.id, c.name, COUNT(DISTINCT o.id)
> FROM customers c
> LEFT JOIN orders o ON o.customer=c.id
> GROUP BY 1, 2

Apparently I misunderstood the question completely. Oh well, just ignore
my message.

Pepak