select count(e.*)
1-- 查询部门gZJiXoCUOo下员工的数量2select count(e.*)3from emp e4join dept d on d.deptno=e.deptno5where d.dname='gZJiXoCUOo';会提示错误:
1mysql> select count(e.*)2-> from emp e3-> join dept d on d.deptno=e.deptno4-> where d.dname='gZJiXoCUOo';5ERROR 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 '*)6from emp e7join dept d on d.deptno=e.deptno8where d.dname='gZJiXoCUOo'' at line 1正确的SQL语句应该是:
1select count(*)2from emp e3join dept d on d.deptno=e.deptno4where d.dname='gZJiXoCUOo';