如何提取相应查询的数据:
"multiple_option_id=10"
和"multiple_option_id=1074"
并返回与此查询对应的"product_id"
?
答案 0 :(得分:1)
这有两种可能性
获取product_id
multiple_option_id
10或1024
获取product_id
multiple_option_id
,其中包含10或1024
对于第一种情况,它相当简单
select product_id from table_name
where multiple_option_id in (10,1024)
对于第二种情况,它将是
select product_id from table_name
where multiple_option_id in (10,1024)
group by product_id having count(*) = 2
答案 1 :(得分:0)
select product_id from table
where multiple_option_id in (10,1024)
答案 2 :(得分:0)
var query = data.GroupBy(item => item.Distance)
.SelectMany(group => group.OrderBy(Guid.NewGuid()));