现在我遇到了麻烦,不知道如何解决。
Declare @brand_id varchar(50) ='brand1, brand2'
SELECT related_brand_id FROM dbo.Category
=> result: Row 1: "brand1, brand3, brand5"
Row 2: "brand3, brand5"
Row 3: "brand5"
Row 4: "brand2, brand5"
...
那么,如何使用参数@brand_id 包含 IN related_brand_id 来选择表 Category 中的所有行?
我的预期结果:
Row 1: "brand1, brand3, brand5"
Row 4: "brand2"
...