Need to write a SQL query to fetch data from a Oracle database -
i need write sql query can fetch data 1 table a.
senario - lets take table has 2 column c1 , c2. c1 has row_id's , c2 has vaues "site=google;site=gmail,site=yahoo"
requirment - need write query can fetch row_id column c1 of table value should come column c2 "google;gmail;yahoo". means should not show "site=" values of c2 column in data fetch. , 1 more condition if there , in place of ; in value query should convert ; , show data.
how this:
select c1, replace(replace(c2, 'site=', ''), ',', ';') c2 table
share , enjoy.
Comments
Post a Comment