How to convert lowercase letters to uppercase and uppercase letters to lowercase in a string. (ex, AbcdEfG should convert as aBCDeFg)
Answer Posted / kunal
SELECT listagg(newstr) within GROUP (
ORDER BY rm)
FROM
(SELECT
CASE
WHEN SUBSTR('AbcdEfG',level,1)=upper(SUBSTR('AbcdEfG',level,1))
THEN lower(SUBSTR('AbcdEfG',level,1))
ELSE upper(SUBSTR('AbcdEfG',level,1))
END newstr,
rownum rm
FROM dual
CONNECT BY level <=LENGTH('AbcdEfG')
)
Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
Is sql sequential or random?
What is anonymous block in sql?
What is query execution plan in sql?
What is the purpose of a sql?
What is group function in sql?
What is the difference between between and in condition operators?
how tsql statements can be written and submitted to the database engine? : Transact sql
What programs use sql?
What is mutating error?
What is the difference between cross join and natural join?
Explain the update statement in sql
How many subqueries can be nested in a statement?
What is native sql query?
What is the difference between function and procedure in pl/sql?
what are tables and fields? : Sql dba