Sql select replace
Sql select replace
Hi All, I had a query related to sql select replace command. i have a table named clusters and it looks like this Code: name characteristics sample 1.1 parent sample 1.2 clone sample 1.3 clone sample 1.4 parent sample 1.5 parent sample 1.6 clone sample 2.1 parent I want all my entries named "sample" to" data" I need like bulk entries changed. The table should look like this clusters Code: name characteristics data 1.1 parent data 1.2 clone data 1.3 clone data 1.4 parent data 1.5 parent data 1.6 clone data 2.1 parent Is it possible using a select replace and update statement? Please do help I did use this SELECT REPLACE ('clusters','sample','data'); but it didnt work I also thought it might because of spacing between sample and number I used this SELECT REPLACE ('cluster','sample*','data*'); but that didnt work too. Please advise |
If the table is named 'clusters' & the column is named 'name', then
Code:
update clusters In fact you should bookmark that entire site, if you use MySQL. If you use another DB, bookmark the relevant site and read it. The code above is basic SQL, so should work on any RDBMS. |
All times are GMT -5. The time now is 02:53 PM. |