sandy1028 Posted June 29, 2009 Share Posted June 29, 2009 Hi, How to select all the rows which has a string ‘&rd’ in a field and update all the rows with the string &rd to single quote in SQL. Quote Link to comment https://forums.phpfreaks.com/topic/164067-select-and-update/ Share on other sites More sharing options...
jackpf Posted June 29, 2009 Share Posted June 29, 2009 UPDATE TABLE SET field=REPLACE(field, '&rd', '\'') Quote Link to comment https://forums.phpfreaks.com/topic/164067-select-and-update/#findComment-865497 Share on other sites More sharing options...
jackpf Posted June 29, 2009 Share Posted June 29, 2009 That single quote is supposed to have a backslash btw. Stupid code highlighter must have stripped it. Quote Link to comment https://forums.phpfreaks.com/topic/164067-select-and-update/#findComment-865498 Share on other sites More sharing options...
sandy1028 Posted July 1, 2009 Author Share Posted July 1, 2009 How to write a query which select field called ids from the table if it has any of the strings like '%”%','%’%','%“%','%‘%' in a row. Please tell me how to query a table as above Quote Link to comment https://forums.phpfreaks.com/topic/164067-select-and-update/#findComment-866933 Share on other sites More sharing options...
abdfahim Posted July 1, 2009 Share Posted July 1, 2009 Select id from table_name WHERE field_name IN ('%”%','%’%','%“%','%‘%') Quote Link to comment https://forums.phpfreaks.com/topic/164067-select-and-update/#findComment-866938 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.