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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need some SQL update help

Status
Not open for further replies.

Kruzer

Programmer
Jun 16, 2000
117
US
I need to update some records by removing prefixes from a value in several hundred records.

current value is "UUU\joeuser"

need the value to be "joeuser"

How would I write the SQL query to update multiple records in the database so that the prefix is removed?


UPDATE Table
SET dUser = '%\%'
WHERE column_name = some_value

Dano
What's your major malfunction
 
UPDATE my_table
SET my_column = SUBSTR(my_column,5)
WHERE SUBSTR(my_column,1,4) = 'UUU\';

I
 
SET dUser = SUBSTRING(dUser FROM POSITION('/' IN dUser)+1)

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top