有沒有辦法檢查某個列的值是否在多行中相同?Mysql - 檢查多行的特定列是否相同
我需要檢查客戶是否在我的數據庫中放置了多個訂單。
如果我做我的選擇
SELECT * FROM orders WHERE email = '[email protected]'
這可能會產生
OrderID Product Amount email
50 Apples 1 [email protected]
50 Oranges 1 [email protected]
50 Bananas 1 [email protected]
91 Apples 1 [email protected]
所以我需要檢查,如果訂單ID是一樣的,在這些行。
但是如何?