前の質問の Employee テーブルと Department テーブルの使用
本社と研究部門で働く従業員数を示す別の結合テーブルを作成しようとしています。
これまでにこれを試しましたが、having 句でエラーが発生し続けます。助言がありますか?
mysql> select e.fname, d.dname
-> from department d
-> inner join employee e on e.dno = d.dnumber
-> group by e.fname
-> having d.dname='Headquarters','Research';
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to
use near ''Research'' at line 5
mysql> select e.fname, d.dname
-> from department d
-> inner join employee e on e.dno = d.dnumber
-> group by e.fname
-> having d.dname=1,5;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to
use near '5' at line 5