home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.databases.oracle      Overblown overpriced overengineered SHIT      2,288 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 1,303 of 2,288   
   AnaCDent to Rohit Dhawan   
   Re: conditional selection of 'AND'   
   17 Apr 04 17:47:17   
   
   From: anacedent@hotmail.com   
      
   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 query gets executed.   
   >   
   > I do not want to use procedure for the above as I think everyting can   
   > be done using and,or,not   
      
   Yes, but only PL/SQL & not in SQL*PLUS.   
   Partly because straight SQL does not support the "IF".   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca