在MySQL中选择多行的特定值和条件依赖项

时间:2018-06-01 13:24:01

标签: mysql

 var processId = process.Id;
        process = null;
        GC.Collect();
        GC.WaitForPendingFinalizers();
        GC.Collect();
        process = System.Diagnostics.Process.GetProcessById(processId);

我们有这样的数据,我们需要选择具有certificate_id 2和3的coach_id。所以,在这里我需要选择coach_id = 7.

1 个答案:

答案 0 :(得分:2)

SELECT coach_id
FROM your_table 
WHERE certificate_id IN (2,3)
GROUP BY coach_id
HAVING COUNT(*)>=2;