How to replace specific text with query result
My request:
select SeqNo, Name, Qty, Price
from vendor
where seqNo = 1;
as shown below:
SeqNo Name Qty Price
1 ABC 10 11
1 -do- 11 12
1 ditto 13 14
The above result shows the vendor name as ABC on the first line, which is correct. Later, when users entered the same manufacturer name "ABC"
as either '-do-'
/ 'ditto'
. Now, in my final query output, I want to replace -do-
and ditto
with ABC
(as in the above example), so my final output should look like this:
SeqNo Name Qty Price
1 ABC 10 11
1 ABC 11 12
1 ABC 13 14
+3
source to share
4 answers