【发布时间】:2016-04-21 14:08:07
【问题描述】:
SELECT FCR.FCR_ID,
FCR.FCR_TITLE FCR_TITLE,
to_char(FCR.FCR_DATE_SUB, 'fmDD Mon YYYY') DATEIN
FROM PMP_SCRIPT FCR,
PMP_SCRIPT_PART CST,
PMP_USER USR,
PMP_SCRIPT_EVENTS PST
WHERE CST.CST_ROLE = 'MANAGER' and
CST.CST_STATUS = 'ADDED' and
CST.CST_USR_ID = 1573752923320092 and
PST.PST_EVENTTYPE = 'ONREVIEW' and
PST.PST_FCR_ID = CST.CST_FCR_ID and
PST.PST_USR_ID = USR.USR_ID and
PST.PST_FCR_ID = FCR.FCR_ID
ORDER BY FCR.FCR_DATE_CREATED;
我得到了以下结果
PAGES TITLE DATEIN
6746061995031488 complex ecosystem 20 Oct 2014
1057034726101865 mutated seabed cores 20 Feb 2013
1057034726101865 mutated seabed cores 20 Feb 2013
2174332191071984 Cheomtherapy Structure design 09 Jan 2013
6541320181289621 Earthquake Epicenter 21 Dec 2013
6541320181289621 Earthquake Epicenter 21 Dec 2014
6541320181289621 Earthquake Epicenter 21 Dec 2013
6541320181289621 Earthquake Epicenter 21 Dec 2013
6541320181289621 Earthquake Epicenter 21 Dec 2013
6541320181289621 Earthquake Epicenter 21 Dec 2013
6541320181289621 Earthquake Epicenter 21 Dec 2013
但我想获得所有独特的结果,有人可以帮助我吗 我已经用不同的关键字尝试过这个,但是查询给出了“不是选择表达式
【问题讨论】:
-
请发布出现错误的查询
-
select distinct怎么样。但是,我鼓励您了解为什么会出现重复并修复查询的其余部分。 -
1.您确定您的查询返回正确的结果吗?查询逻辑(尤其是
WHERE子句)中是否有任何错误导致查询返回重复值? 2. 出现not selection expression错误,因为您是按查询未返回的列对查询结果进行排序的。 -
是的逻辑正确实现
标签: sql oracle plsql oracle-sqldeveloper