Subject | Re: [firebird-support] Unbilled orders |
---|---|
Author | Pavel Menshchikov |
Post date | 2005-06-15T12:44:50Z |
Hello André,
l> Now I am doing something like this:
l> SELECT
l> orders.orderno,
l> orders.ordertitle
l> FROM
l> orders
l> WHERE
l> (SELECT
l> COUNT(bills.bill_ID)
l> FROM
l> bills
l> WHERE
l> bills.bill_reference = orders.orderno)
l> = 0
l> This works devilishly fast for me (in comparison with dBase...) but I
l> would like to know if this is the recommended approach or if there is
l> something more sneak.
You could try the following also:
-----
SELECT
orders.orderno,
orders.ordertitle
FROM
orders
WHERE
NOT EXISTS
(SELECT
1
FROM
bills
WHERE
bills.bill_reference = orders.orderno)
-----
HTH
--
Best regards,
Pavel Menshchikov
http://www.ls-software.com
l> Now I am doing something like this:
l> SELECT
l> orders.orderno,
l> orders.ordertitle
l> FROM
l> orders
l> WHERE
l> (SELECT
l> COUNT(bills.bill_ID)
l> FROM
l> bills
l> WHERE
l> bills.bill_reference = orders.orderno)
l> = 0
l> This works devilishly fast for me (in comparison with dBase...) but I
l> would like to know if this is the recommended approach or if there is
l> something more sneak.
You could try the following also:
-----
SELECT
orders.orderno,
orders.ordertitle
FROM
orders
WHERE
NOT EXISTS
(SELECT
1
FROM
bills
WHERE
bills.bill_reference = orders.orderno)
-----
HTH
--
Best regards,
Pavel Menshchikov
http://www.ls-software.com