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.



I have following column in the table. col1 1 a b c 2 3 d and I want to display it as nu..

Answer / 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

More SQL PLSQL Interview Questions

what are the different types of joins?

4 Answers   Choice Solutions,


What are the different types of a subquery?

0 Answers  


Why do we use procedures in sql?

0 Answers  


What is a primary key sql?

0 Answers  


What is the file extension for sql database?

0 Answers  






What is sql and how does it work?

0 Answers  


i have a table like this. cityno cityname mails 1 BANGALORE 8KM 2 HSR LAYOUT 20KM 3 MEJISTIC 30KM 4 JAYADEVA 55KM 5 ITPL 80KM 6 HEBBAL 115KM I HAVE DATA LIKE THIS I WANT O/P LIKE THIS DISTANCE NO.OFCITY 0-50KM 3 51-100KM 2 101-150KM 4 AND SO ON pls give me answer. i want urgent

6 Answers  


What does count (*) mean?

0 Answers  


What is mdb stand for?

0 Answers  


what does it mean to have quoted_identifier on? : Sql dba

0 Answers  


Difference between SUBSTR and INSTR?

3 Answers  


what are the tunnig tables you used for tuning a query and tell me some of coloumns in that tuning tables?

1 Answers   Metric Stream,


Categories