开发者

SQL UPDATE question for large fields

开发者 https://www.devze.com 2023-03-27 01:15 出处:网络
So I have a table with a field that I wish to work with in a mySQL database.It\'s function is a long list of keywords used for fulltext search so the field is rather long.

So I have a table with a field that I wish to work with in a mySQL database. It's function is a long list of keywords used for fulltext search so the field is rather long.

For example:

Table
'data_index'
shirt t-shirt list item red black brown green purple sleeveless...etc for about 20 lines

I would like to match a separate string, lets define as:

$string  = "teeshirt shert shertt shirtt";

I would like to ADD these items in $string to the list without having to grab the entire value in each data_index field. Essentially I don't want to have to use the UPD开发者_JAVA技巧ATE sql command and use the entire data_index value in this query. Is this possible?


UPDATE tablename SET data_index = CONCAT(data_index, 'your new keywords') WHERE ...
0

精彩评论

暂无评论...
验证码 换一张
取 消