Subject Re: [ib-support] Select SQL
Author Ann W. Harrison
Sandeep,

> >
> > SELECT * FROM TableA WHERE Number IN (SELECT MAX(Number) FROM TableA WHERE
> > Number < 1000)

This might be faster....

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.