【发布时间】:2018-10-28 18:52:43
【问题描述】:
我给出以下错误:“ORA-01785: ORDER BY item must be the number of a SELECT-list expression”当我尝试使用“order by”选择 id_prof 并在不同表中的列之间建立联合时.
命令如下:
select substr(nume, 1, 1)||'.'||regexp_replace(prenume, '[aeiou]', null, 1, 0, 'i') as "Rododendron"
from studenti
union
select ceil(sqrt(to_number(substr (id_prof, 2, 1))*2)) as "Fata de con"
from profesori
where grup_didactic = 'Lect'
order by to_number(substr (id_prof, 2, 1)) desc;
表格如下图:FirstPictureSecondPicture
我想最后有两列。
第一个应包含“nume”的第一个字母,并与 '.' 连接。和没有元音的“prenume”(名为“Rododendron”的列)。
在第二个中,我想从 id_prof 的数字的双倍(名为“Fata de con”的列)中获得平方根,用于“profesori”中可以找到的所有内容,其中 grup_didactic = 'lector ' 并且所有内容都在 id_prof 之后按 desc 排序。
有什么帮助吗?
【问题讨论】: