272. Which two statements are true regarding subqueries? (Choose two.)
A. The ORDER BY clause can be used in the subquery.
B. A subquery can be used in the FROM clause of a SELECT statement.C. If the subquery returns NULL, the main query may still return result rows.D. A subquery can be placed in a WHERE clause, GROUP BY clause, or a HAVING clause.E. Logical operators, such as AND, OR and NOT, cannot be used in the WHERE clause of a subquery.Answer: AB大家觉得这个A对吗?在subquery中使用order by进行排序,我觉得有问题,哪个大牛给解释一下啊?谢谢
A. The ORDER BY clause can be used in the subquery.
B. A subquery can be used in the FROM clause of a SELECT statement.C. If the subquery returns NULL, the main query may still return result rows.D. A subquery can be placed in a WHERE clause, GROUP BY clause, or a HAVING clause.E. Logical operators, such as AND, OR and NOT, cannot be used in the WHERE clause of a subquery.Answer: AB大家觉得这个A对吗?在subquery中使用order by进行排序,我觉得有问题,哪个大牛给解释一下啊?谢谢
只是不必要的尽量避免,以免影响性能而已
select * from (select * from tt order by id) where rownum<100
这个就是,大家常用的分页语句
---------- ----------
3 800
20 500
100 200
100 200
100 100
100 100已选择6行。SQL> select * from zzw_test600 where id in (select id from zzw_test700 order by id);
select * from zzw_test600 where id in (select id from zzw_test700 order by id)
*
ERROR 位于第 1 行:
ORA-00907: 缺少右括号这样的情况为什么不合适啊?