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

How is pl sql different from sql?

0 Answers  


Does varchar need length?

0 Answers  


Explain what is table in a database?

0 Answers  


What is the purpose of cursors in pl/sql?

0 Answers  


What is the difference between cross join and natural join?

0 Answers  






is mysql query is case sensitive? : Sql dba

0 Answers  


In testing where do we use sql language and how it helps in testing?

2 Answers  


How to disable a trigger name update_salary?

0 Answers  


What is primary key and unique key?

0 Answers  


Can we insert in view in sql?

0 Answers  


What will be the output of the following String S = 1+2+"abc" S = ? String S1 = 1+2+"abc"+5+6 S1 = ?

1 Answers   ABC,


How to Declare Fixed Length String Value In PL SQL

0 Answers  


Categories