select * from table1 from (select field2 from table2 order by field2 desc) as table 两个from当然出错。 是不是这样select * from (select field2 from table2 order by field2 desc) as table
select * from (select TOP 100 PERCENT field2 from table2 order by field2 desc) as tableName
select * from (select field2 from table2 order by field2 desc) as a
select * from (select top 1 field2 from table2 order by field2 desc) as table
select * from (select field2 from table2 order by field2 desc) as Tab
字查询使用ORDER BY 会提示要指定TOP
select * from (select field2 from table2 ) as [table ] order by field2 desc??
select * from table1 from....select * from (select field2 from table2 order by field2 desc) as Tab
order by 不能放在子句里。 select * from (select field2 from table2) as table order by table.field2 desc
order by 是不允许放子查询的,除非加top。 一般说来,在内层排序可以拿到外不来排序。select * from table1,(select field2 from table2) as [table] order by [table].field2 desc
那個我打錯的。子查詢不能加order的
这个oracle的怎么解决 非常郁闷
1、首先子查询中可以使用order by! 2、楼主的问题,我觉得是 as 用法错误 ,跟order by 是否应用子查询没有关系。修改成为即可 select * from table1 from (select field2 from table2 order by field2 desc) table 3、下面截取官档一段order by 和 rownum 一起用的范例! If you embed the ORDER BY clause in a subquery and place the ROWNUM condition in the top-level query, then you can force the ROWNUM condition to be applied after the ordering of the rows. For example, the following query returns the employees with the 10 smallest employee numbers. This is sometimes referred to as top-N reporting:SELECT * FROM (SELECT * FROM employees ORDER BY employee_id) WHERE ROWNUM < 11;
select * from table1 from (select field2 from table2 order by field2 desc) as table 两个from当然出错。
是不是这样select * from (select field2 from table2 order by field2 desc) as table
select * from (select field2 from table2 order by field2 desc) as a
select * from (select field2 from table2 ) as [table ]
order by field2 desc??
如果有top n 的话, 可以有order by.
select * from table1 from....select * from (select field2 from table2 order by field2 desc) as Tab
select * from (select field2 from table2) as table
order by table.field2 desc
一般说来,在内层排序可以拿到外不来排序。select *
from table1,(select field2 from table2) as [table]
order by [table].field2 desc
2、楼主的问题,我觉得是 as 用法错误 ,跟order by 是否应用子查询没有关系。修改成为即可 select * from table1 from (select field2 from table2 order by field2 desc) table
3、下面截取官档一段order by 和 rownum 一起用的范例!
If you embed the ORDER BY clause in a subquery and place the ROWNUM condition in the top-level query, then you can force the ROWNUM condition to be applied after the ordering of the rows. For example, the following query returns the employees with the 10 smallest employee numbers. This is sometimes referred to as top-N reporting:SELECT * FROM
(SELECT * FROM employees ORDER BY employee_id)
WHERE ROWNUM < 11;