Subject | Re: [ib-support] Select SQL |
---|---|
Author | Ivan Prenosil |
Post date | 2001-10-31T12:33:41Z |
> SELECT * FROM TableA WHERE Number IN (SELECT MAX(Number) FROM TableA WHEREBecause of using non-correlated scalar subquery,
> Number < 1000)
> Select * from tableA where Number in
> (Select Max(Number) from tableA
> where Number < 1000)
you get much better plan if you use "=" instead of "IN"
(thanks Ann for explanation).
Also do not forget that Max() can use only Descending index.
Ivan
http://www.volny.cz/iprenosil/interbase