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 / 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 |
How many row comparison operators are used while working with a subquery?
Explain the the delete statements in sql?
What is sql and explain its components?
Is not null in sql?
What is a stored procedure ?
What is the use of sqlerrd 3?
What is procedure function?
Why are cursors used?
What does <> sql mean?
Can you have a foreign key without a primary key?
What is a primary key called that is made up of more than one field?
What operating systems are supported by oracle sql developer?