我想选择所有也符合特定fix_id的重复记录。
*------*-------------*---------*
| id time_stamp | fix_id |
*------*-------------*---------*
| 1 | 790 | 5679 |
| 2 | 1000 | 245679 |
| 3 | 1000 | 245679 |
| 4 | 12 | 245679 |
| 5 | 790 | 5679 |
*------*-------------*---------*
我想用下面的代码找回id 2和3,但它返回2,3和4所有具有相同fix_id
SELECT *
FROM odds
WHERE time_stamp IN (SELECT time_stamp
FROM odds
GROUP BY time_stamp
HAVING COUNT(time_stamp) > 1) and fix_id='245679'
Cats萌萌
LEATH