简体   繁体   中英

MYSQL bitwise AND

LanguageTable
language_ID | language
1           | english
2           | german
3           | french

EmployeeTable
employee_ID | language_ID
1           | 1
2           | 2
2           | 3
3           | 3
4           | 2

Select the employee who speaks German and French

And don't tell me

SELECT EmployeeTable.employee_ID FROM EmployeeTable WHERE language_ID = 3 & 2

because that doesn't work

select a.employee_ID  from EmployeeTable a join EmployeeTable b on a.employee_ID =b.employee_ID  where a.language_ID='2' and b.language_ID='3'

尝试这个

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM