WHERE IN vs. WHERE OR OR OR
Posted in 1998
Daniel Kirkdorffer — — source: Informix-list mailing list archive (1991-1998)
Hi,
Using JDBC against and Informix database I was wondering if anyone
knew which WHERE clause would be more efficient:
SELECT x FROM y WHERE x IN (1, 2, 3,..., n)
or
SELECT x FROM y WHERE x = 1 OR x = 2 OR x = 3 OR ... OR x = n
(Where x is a primary key)
Would the choice be the same if n > 100, or even n > 1000?
Any suggestions would be greatly appreciated.
Dan
--
Daniel Kirkdorffer
Sr. Consultant, Syllogistics, LLC.
Email: dan.kirkdorffer 'at' syllogistics 'dot' com
daniel.kirkdorffer 'at' attws 'dot' com
Web: http://www.syllogistics.com/
http://members.aol.com/dankirkd/
Visual Cafe Tips:
http://members.aol.com/dankirkd/vcafe.htm