0
How to do the query of "replace 2nd character with * and 4th character with and.
7 Answers
+ 2
Okay, you can try this, but mind that implementation of it depends on which DBMS you are using, and since you did not define a condition, this will update ALL the records, unless you add a WHERE clause.
If you use Oracle, replace CONCAT arguments separator to using '||' instead of comma.
If you use Ms Sql Server you may opt to combine the arguments using '+' and skip CONCAT all the same.
UPDATE employee SET job = CONCAT(SUBSTRING(job,1,1),'*',SUBSTRING(job,3,1),'&',SUBSTRING(job,5));
I'm not on a computer to have the query tested, but I guess you can figure out if something isn't right.
Hth, cmiiw
+ 2
What's the table name, field name and field size? replace the fourth character with 'and' or 'and.' there's a dot character after 'and' in your question title.
+ 2
Alright, did it work?
0
it's employee table
0
I want to replace the 2nd character of job with '*'
and 4th character of job with '&' rest of the characters in lower case
0
thank you so much
0
ya it was worked.....đ