Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Replace

Status
Not open for further replies.

rekhatr10

Programmer
Apr 2, 2004
67
US
Hi everyone,

I have to replace the strength of drugs from u to unit so that there won't be any mistakes.

Data

40 u/ml
0.025 mg-1.75 mg-10000 u/ml
400 u-10 mg-3.5 mg-10000 u/gm
15 u-10 u/0.5 ml

Any suggestions would be helpful.

REkha
 
What is the expected output from the above data?
Should all occurences of u in the above statement be replaced by unit? or just the ones entitled u-10?



"I'm living so far beyond my income that we may almost be said to be living apart
 
Code:
update yourtable
   set yourcolumn 
     = replace(yourcolumn,'u','unit')
this will work well provided that there is no other word with u in it besides those u/xx words you've shown in your examples

rudy
SQL Consulting
 
mackilliop

All occurances of 'u' has to be replaced with unit

RR
 
okay, then use the update statement i gave you, it will replace every occurrence of 'u' (no quotes) with 'unit'

rudy
SQL Consulting
 
as r937 says its the easiest and best way of doing what you ask.

In the previous post ( you asked to change u to iu, the statement shown above will change iu to be iunit. Is this what you expect or is this a different field?



"I'm living so far beyond my income that we may almost be said to be living apart
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top