您是否可能只是在JSON_包含的JSON上选择ID作为JSON?我不知道生成的代码应该是什么样子,除了一些类似的东西:
JSON_CONTAINS(pp.ids_produits_parure->'$[*]', CAST(pp as JSON))
因为我怀疑ID是数组,你不搜索pp而不是p吗?
参考: https://dev.mysql.com/doc/refman/8.0/en/json-search-functions.html#:~:text=JSON_CONTAINS%20%28target%2C%20candidate%20%5B%2C%20path%20%5D%29%20Indicates%20by,found%20at%20a%20specific%20path%20within%20the%20target.