Subject | Re: [ib-support] Select SQL |
---|---|
Author | Ann W. Harrison |
Post date | 2001-10-31T15:51:14Z |
Sandeep,
SELECT * FROM TableA
WHERE Number = (SELECT MAX(Number)
FROM TableA WHERE Number < 1000)
SELECT MAX is a guaranteed singleton select so the = works and
will generate better code.
Regards,
Ann
www.ibphoenix.com
We have answers.
> >This might be faster....
> > SELECT * FROM TableA WHERE Number IN (SELECT MAX(Number) FROM TableA WHERE
> > Number < 1000)
SELECT * FROM TableA
WHERE Number = (SELECT MAX(Number)
FROM TableA WHERE Number < 1000)
SELECT MAX is a guaranteed singleton select so the = works and
will generate better code.
Regards,
Ann
www.ibphoenix.com
We have answers.