Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

I have following column in the table.
col1
1
a
b
c
2
3
d

and I want to display it as
num chars
1 a
2 b
3 c
4 d

numbers in one column and letters in another column.

Answer Posted / sreenivasulu sangatipalli

SELECT REGEXP_SUBSTR(COL,'[A-B]+',COL) AS COL1,REGEXP_SUBSTR(COL,'[1-9]+',COL) AS COL2 FROM TEST10;
SELECT * FROM (SELECT CASE WHEN REGEXP_LIKE(COL,'[A-Z]+','i') THEN COL END ALPHS,
CASE WHEN REGEXP_LIKE(COL,'[0-9]+') THEN COL END NUMBS
FROM TEST10 ) where ALPHS is not null OR NUMBS is not null;

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can I call a procedure inside a function?

971


What are the popular database management systems in the it industry?

947


What will you get by the cursor attribute sql%rowcount?

995


What is a sql schema used for?

1060


How to return an array from java to pl/sql?

1081


what are the advantages and disadvantages of cascading style sheets? : Sql dba

1023


what happens if you no create privilege in a database? : Sql dba

956


What are different types of indexes?

979


What is clause?

1095


How do you pronounce sql?

974


What is pessimistic concurrency control? : Transact sql

1046


what are dynamic queries in t-sql? : Transact sql

987


how to load data files into tables with 'mysqlimport'? : Sql dba

1060


What is difference between sql and mysql?

1080


What are the usages of sql?

1030