MShiyanovsky <[EMAIL PROTECTED]>
wrote:
I have two tables as follows:
CREATE TABLE services( id INTEGER , description BLOB);
CREATE TABLE customers( id INTEGER , service INTEGER);
Some customers doesn't use service. So I need something like this:
select c.id, s.id
from customers c
left outer join
(select id from services) as s
on c.service = s.id;
Why not just
select c.id, s.id
from customers c left outer join services s
on c.service = s.id;
Both tables have indices on id field but sqlite uses full nested loop
on second table.
You force it to, but using a sub-select unnecessarily.
Igor Tandetnik
-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------