On Wed, 18 Feb 2015 08:55:37 +0100 gunnar <gharms at hiqinvest.nl> wrote:
instead of
> SELECT *
> FROM ordercallback
> WHERE account=@ACCOUNT
> AND cb_seq_num>(
> SELECT cb_seq_num
> FROM ordercallback
> WHERE cb_uuid=@CBUUID);
SELECT *
FROM ordercallback ocb
WHERE account=@ACCOUNT
AND exists (
SELECT 1
FROM ordercallback
WHERE cb_uuid=@CBUUID
and ocb.cb_seq_num > cb_seq_num );
No union, no limit, no order. Just existential quantification. :-)
--jkl

