1
我需要與工會有兩個條件,選擇從表中的數據,從表中的數據,或者任何用於表如何有兩個條件選擇
name special
Deepak s
mukesh v
dinesh s
girgesh v
Deepak s
mukesh v
dinesh s
girgesh v
Deepak s
mukesh v
dinesh s
girgesh v
查詢獲取數據...
SELECT NAME FROM student WHERE special = "s" LIMIT 2
UNION
SELECT NAME FROM student WHERE special = "v" LIMIT 2
但它在聯合之前只給出第一個條件... 如何從單個表中獲取兩個不同的條件數據
使用'union all' –
SELECT nAME FROM student WHERE special =「s」OR special =「v」LIMIT 2 –