Re: How can we match a condition among 2 diff. tables?

Поиск
Список
Период
Сортировка
От Joe Conway
Тема Re: How can we match a condition among 2 diff. tables?
Дата
Msg-id 009a01c10bcd$a5383510$47d310ac@jecw2k1
обсуждение исходный текст
Ответ на Re: How can we match a condition among 2 diff. tables?  (Stephan Szabo <sszabo@megazone23.bigpanda.com>)
Список pgsql-sql
> >  Now, i need to get the details of all employees who did 
> >  receive NONE of the salesorders. ie.. i wish to select the 
> >  records of table 'employee' whose 'emp_id' are not 
> >  there in table 'salesorder'.
> >  
> >  I need to accompolish in a single query!

This should work:

select e.emp_id
from employee as e left join salesorder as s on e.emp_id = s.emp_id
where s.emp_id is null;


-- Joe



В списке pgsql-sql по дате отправления:

Предыдущее
От: "Josh Berkus"
Дата:
Сообщение: Re: You have an error in your SQL syntax near '' at line 1
Следующее
От:
Дата:
Сообщение: Re: Date Validation?