g_Jericho
27th January 2003, 11:32
Hi,
I want to find all the Purchase orders for which there are no lines maintained as yet, how do we write a query for this.
I tried with something like

Select tdpur040.orno
from tdpur040, tdpur041
where tdpur040.orno <> tdpur040.orno
order by tdpur040.orno

But i m not getting the desired result, Is it that i cannot use the "<>" operator? or is there something wrong with the query itself.

Jericho

g_Jericho
27th January 2003, 14:07
select
tdpur040.orno,
tdpur040.suno
from tdpur040
where not exists (
select tdpur041.orno
from tdpur041
where tdpur041.orno = tdpur040.orno)
order by tdpur040.orno