Home » SQL & PL/SQL » SQL & PL/SQL » where condition based on column value
where condition based on column value [message #359628] Mon, 17 November 2008 13:27 Go to next message
Messages: 17
Registered: October 2008
Junior Member
I got a scenario in oracle 10g that
where condition should be based on value of a column

for eg

not in condition for col5 should be based on col4 value and heres the query which i think should work for the scenario given
but taking too much time ..Just wanted to know whether it can be done in some other optimized way.

select col1,col2,col3 where (
(col4=1 and col5 not in ('yy','zz'))
(col4=2 and col5 not in ('cc','bb'))

Re: where condition based on column value [message #359632 is a reply to message #359628] Mon, 17 November 2008 13:38 Go to previous message
Michel Cadot
Messages: 65144
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
It is OK.

Previous Topic: How to build a function in order to be called in SQL
Next Topic: Indexing
Goto Forum:

Current Time: Sun Aug 20 14:20:43 CDT 2017

Total time taken to generate the page: 0.01695 seconds