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 651 of 2,288   
   VC to Bernard Drolet   
   Re: Extract the beginning of a string   
   06 Nov 03 23:32:11   
   
   From: boston103@hotmail.com   
      
   Hello Bernard,   
      
   You can do it so:   
      
   select translate('xyz174',   
      
   'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789',   
                    'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz')   
   from dual;   
      
   Rgds.   
      
   "Bernard Drolet"  wrote in message   
   news:ee7856eb.0311061513.6c9539e1@posting.google.com...   
   > Hi,   
   >   
   > I have a column containing a string; the string always starts with a   
   > letter (a-z), followed by an undefined number of letters, then one   
   > number or more.   
   >   
   > The REGEXP would look like [a-zA-Z][a-zA-Z]*[0-9]+   
   >   
   > I need to extract the letters at the beginning in an SQL query or in   
   > PL/SQL   
   >   
   > For example, If I have   
   >   
   > abc123 -> abc   
   >   
   > a123 -> a   
   >   
   > abcdefgh1 -> abcdefgh   
   >   
   >   
   >   
   > Any suggestion ?   
   >   
   >   
   > Thank you   
   >   
   >   
   >   
   > Bernard Drolet   
      
   --- 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