Hello, Thanks for sharing knowlegde and updating video. In Last Interview I faced question like.. I want swap to 2 columns (values) how we can do it in SQL ?.. Please assist.
Hi Akshay, Please find the answer create table t1(c1 number, c2 number); drop table t1; insert into t1 values(1,2); insert into t1 values(3,4); update t1 set c1=c2,c2=c1; select * from t1;
Hello, In previous interview i got new question like... If space is present in any character string.. How can we count the space?? Please help for the same
Hi @shiva sir, how translate will work if we want to translate in generic column for eg : translate('Mahendra', 'h', '#') output is : Ma#endra similiar if we can apply on ename colomn of emp table, every 3rd character replaces to # symbols, what would be the query ?please help
@Mahendra, you can use the column name instead of the hard coded value. suppose if you want to translate 'h' to '#' in all the employee names in emp table, then you can write like "SELECT translate(ename,'h','#') FROM EMP' I hope this is what you are looking for, please check and let me know if this is not your expectation.
Hi Sir , I have doubt on translate If we give replace string is more then actual string what will be the output.Like below EX: Select translate('welcome to the oracle class','oracle','2345678')
@Sai Krishna, it wont give any error, instead it ignores the extra char at the end.... for example, the above query will replace the o with "2", r with "3", a with "4", c with "5", l with "6" and e with "7", and ignores the "8"
If I want to translate column values with specified character Ex. Address Hyderabad Chennai So I want to translate Hyderabad with underscore Output Address _ _ _ _ _ _ _ _ like this Translate (Address,....,"_") How to write the query tell