我試圖從同一屬性列中獲得掌握2個值(MySQL和Python)的eNum(員工編號),我得到的距離最近,但eNum被複制。我只想得到一個eNum。我想我搞亂它在WHERE子句中......我不知道......顯示ID共享來自同一屬性的2個值
mysql> select * from employee_expert;
+------+---------+
| eNum | package |
+------+---------+
| E246 | Excel |
| E246 | MySQL |
| E246 | Python |
| E246 | Word |
| E403 | Jave |
| E403 | MySQL |
| E892 | Excel |
| E892 | PHP |
| E892 | Python |
+------+---------+
mysql> SELECT eNum, package
FROM employee_expert
WHERE (package = 'MySQL' OR package = 'Python') AND (package = 'MySQL' OR package = 'Python')
GROUP BY package;
+------+---------+
| eNum | package |
+------+---------+
| E246 | MySQL |
| E246 | Python |
+------+---------+
非常感謝!我想我需要深入瞭解JOIN和子句... – eneko