文章詳情頁
mysql - select查詢多個紀錄的條件怎么寫
瀏覽:379日期:2022-06-16 17:41:53
問題描述
select查詢多個紀錄的條件怎么寫例如有個表id data1 2.31 5.31 3.22 1.32 5.33 1.33 2.33 2.4現在要插入數據1.3和5.3,要可以插入他們的id是新的4,有數據重復就不能插入現在表里已經有id=2的兩個記錄怎么寫一句select查詢出來?id未知
問題解答
回答1:你這提問,感覺表達都不清楚
回答2:不知道是否是這個意思select id,count(1) from table group by id having count(1)>1
回答3:select id, data from table where data in (1.3, 5.3)
相關文章:
排行榜
