Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> Sql Query

Sql Query

From: Sanjay Mishra <smishra_97_at_yahoo.com>
Date: Mon, 20 Mar 2006 07:57:56 -0800 (PST)
Message-ID: <20060320155756.6652.qmail@web51305.mail.yahoo.com>


Hi Everybody    

  I need some SQL expert Help to write a complex query( atleast for me)    

  I am writing a procedure which will be passed a string which consist of value like
(col1,value,col2,value,col3,value, and so on)
   

  What I need is that it should be changed to   col1=value
  and col2=value
  and col3=value    

  In addition, there are three rules
  Rule 1



  If col1 and col2 are same,[ only adjacent col can be same], then search string should be like Col1 in (value1,value2)    

  Rule 2



  If col contain value like ABC% then search string for that col is COL3 LIKE ABC%    

  Rule 3



  if two adjacent col contains value AAAA and ABC%, then it should be transformed into
(COL3 ='AAA' or COL3 like ABC%)
       

  Also any suggestion as how I can check if the value is number or String            

  The String passed will be like    

  Col1,111,Col2,AAAA,Col2,AB%,COL2,BBBB,Col3,23454,Col3,1212    

  Thanks
  Sanjay                 



Brings words and photos together (easily) with  PhotoMail - it's free and works with Yahoo! Mail.
--
http://www.freelists.org/webpage/oracle-l
Received on Mon Mar 20 2006 - 09:57:56 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US