我有这个查询,我在客户端使用它来从几个表中创建一个搜索字段。
update xcart.xcart_products_lng_en
left join xcart.xcart_products on xcart.xcart_products.productid = xcart.xcart_products_lng_en.productid
left join xcart.xcart_extra_field_values on xcart.xcart_extra_field_values.productid = xcart.xcart_products.productid
set xcart.xcart_products_lng_en.keywords = CONCAT(product , " ", productcode, " ",
(select group_concat(xcart.xcart_extra_field_values.value
order by `xcart`.`xcart_extra_field_values`.`productid`
separator " ")
from xcart.xcart_extra_field_values
where xcart.xcart_extra_field_values.productid = xcart.xcart_products_lng_en.productid ))
where value is not null or value not like ''
这可以按预期工作,但是当它获得太多值时它太松了,所以我添加了
fieldid != 11 or fieldid != 10 or fieldid != 12 or fieldid != 18 or fieldid != 19 or
fieldid != 20
or fieldid != 15 or fieldid != 3 or fieldid != 16
但这被忽略了。有什么我公然错过的吗?