不可忽视的SQL语句执行顺序
SQL> select department_id,sum(salary)
2 from employees
3 where sum(salary)>30000;
为上面上面的语句会报错?
是因为执行顺序的原因先from 数据源,然后select ,确定涉及哪些列,然后where 看数据源哪些记录满足条件然后grup by ,然后having ,然后显示order by
SQL> select department_id,sum(salary)
2 from employees
3 where sum(salary)>30000;
为上面上面的语句会报错?
是因为执行顺序的原因先from 数据源,然后select ,确定涉及哪些列,然后where 看数据源哪些记录满足条件然后grup by ,然后having ,然后显示order by