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 different types of tables in sql?

0 Answers  


what are the different index configurations a table can have? : Sql dba

0 Answers  


i have a table with column sno with 30 records. i want to update this column by item by item in asp.net. i wantto enter new values into that from 1 to 30 how is it possible with backend c#

1 Answers  


Why primary key is required?

0 Answers  


what is a trigger in mysql? Define different types of trigger. : Sql dba

0 Answers  






What is scalar and vector?

0 Answers  


what is HASH join?

2 Answers   Genpact, HCL,


Which one is the Best approach to put code, among Triggers and Procedures? Explain?

1 Answers   Sierra Atlantica,


What is primary key and foreign key with example?

0 Answers  


What is the maximum number of triggers, you can apply on a single table?

0 Answers  


What are sql ddl commands?

0 Answers  


Explain the select statement in sql?

0 Answers  


Categories