Follow Our FB Page << CircleMedia.in >> for Daily Laughter. We Post Funny, Viral, Comedy Videos, Memes, Vines...

Suppose There is a string
A.B....C.......D.........E........F In this string dots (.)
are not having fixed count in between of string. I want the
output to have string with one dot between. I.e.
A.B.C.D.E.F

Answers were Sorted based on User's Feedback

Suppose There is a string A.B....C.......D.........E........F In this string dots (.) are not h..

SELECT replace(replace(replace('A.B....C.......D.........E........F','.',' @'),'@ ',''),' @','.') FROM dual

 Is This Answer Correct ? 8 Yes 1 No

Suppose There is a string A.B....C.......D.........E........F In this string dots (.) are not h..

SELECT REGEXP_REPLACE (
Replace ('A.B....C.......D.........E........F', '.', ' '),
'( ){1,}',
'.')
FROM DUAL;

 Is This Answer Correct ? 3 Yes 2 No

Suppose There is a string A.B....C.......D.........E........F In this string dots (.) are not h..

SELECT regexp_replace('A...B..C.D......E....F', '[.]+', '.') FROM DUAL;

 Is This Answer Correct ? 0 Yes 0 No

Suppose There is a string A.B....C.......D.........E........F In this string dots (.) are not h..

SELECT REGEXP_REPLACE (
REPLACE ('A.B....C.......D.........E........F', '.', ' '),
'( ){2,}',
'.')
FROM DUAL;

 Is This Answer Correct ? 3 Yes 5 No

Suppose There is a string A.B....C.......D.........E........F In this string dots (.) are not h..

select  REGEXP_REPLACE ('A.B....C.......D.........E........F','.{1,}',
'.') FROM DUAL;

 Is This Answer Correct ? 0 Yes 2 No

Suppose There is a string A.B....C.......D.........E........F In this string dots (.) are not h..

select replace(regexp_replace(replace
('A.B....C.......D.........E........F','.',' '),'( )
{2,}',' '),' ','.') from dual

 Is This Answer Correct ? 1 Yes 13 No

More SQL PLSQL Interview Questions

what are the performance and scalability characteristics of mysql? : Sql dba

Is sql database free?

what is a record in a database ? : Sql dba

ename empno deptno amar 1 10 akbar 2 20 anthonny 3 30 jonathan 4 40 write a procedure to dispaly the column values ina row separated by a deleimiter eg - input - select ename from emp '|' output - amar|akbar|anthony|jonathan input - select empno from emp '@' o/p - 1@2@3@4 input - select deptno from emp '/' o/p - 10/20/30/40 Pls answer this questn.

does sql support programming? : Sql dba

How many types of database triggers can be specified on a table ? What are they ?

Differentiate between pl/sql and sql?

What is difference between hql and sql?

How can i insert data inro a table with 3 columns using FORALL?

If an unique key constraint on DATE column is created, will it validate the rows that are inserted with SYSDATE?

sql query to get zero records from a table having n no of records

How do I find duplicates in two columns?

Categories