Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: conditional selection of 'AND' or 'Select' in Oracle
You are wrong, it does:
DECODE
or
CASE WHEN ... THEN ... ELSE .. END
Jan
AnaCDent <anacedent_at_hotmail.com> wrote in message news:<SCkgc.55085$U83.54238_at_fed1read03>...
> Rohit Dhawan wrote:
> > I have one query similar to the following:-
> >
> > select coursenum,sectionnum,instructor from
> > SECTION s where (sectionnum = '001')
> > and coursenum LIKE 'MATH%'
> >
> >
> > but is it possible to add another 'and' condition to the above query
> > provided a certain user parameter = 'add'
> >
> > for e.g
> >
> > select coursenum,sectionnum,instructor from
> > SECTION s where (sectionnum = '001')
> > and coursenum LIKE 'MATH%'
> > and instructor LIKE 'L%' i.e. only and only if :parameter = 'add' else
> > the above (first)query gets executed.
> >
> > I do not want to use procedure for the above as I think everyting can
> > be done using and,or,not
>
> HOW?
> SQL language does NOT provide any type of conditional statement
> such as IF, THEN, ELSE
Received on Mon Apr 19 2004 - 05:15:12 CDT