Joining Objects

Oct 12, 2010 at 11:39 AM

I'm really at lost finding a solution to my problem. How do I transform this SQL to PHPLinq?

SELECT *
FROM [dbo].[Customers] AS [t0]
WHERE [t0].[CustomerID] NOT IN (
    SELECT [t1].[CustomerID]
    FROM [dbo].[Orders] AS [t1]
)

Coordinator
Oct 12, 2010 at 12:59 PM

hHis one is possible with PHPLinq but the query will not be optimized. Instead, PHPLinq in its current implementation will read all orders and all customers into memory. Therefore I think it's best to just execute this query natively on the database and fetch the results in PHP.