如何从多个表和列中从Oracle中检索数据而不重复?

时间:2019-05-12 16:35:43

标签: oracle

我正在尝试从3个不同的表中检索不同的数据。

我的查询如下:

SELECT T.Topic,T.EventNo, T.EventType, T.EventLoc, T.EventDate, T.StartTime, T.EndTime, T.Details, ((ES.SFirstName || ' ' || ES.SLastName))AS SPEAKER
FROM TIMETABLE T
      , EXTERNALSPEAKER ES
      , SPEAKEREVENT SE
WHERE T.EventNo = SE.EventNo 
AND ES.SpeakerID = SE.SpeakerID 
AND EventDate >= SYSDATE
ORDER BY EventDate;

结果如下:

Normalization by Evaluation for Sized Dependent Types   4   Lecture CH.03.024, FLOOR 1
Normalization by Evaluation for Sized Dependent Types   4   Lecture CH.03.024, FLOOR 1
Careers and Employment Information Workshop 1   Workshop    Park Plaza Westminster Bridge Hotel
Object-Oriented Software Design 2   Lecture CH.02.054, FLOOR 3
Doing for our robots what evolution did for us  3   Lecture CH.01.044, FLOOR 4
Doing for our robots what evolution did for us  3   Lecture CH.01.044, FLOOR 4

我已经花了几个小时,但无法弄清楚。我是SQL新手。

谢谢!

1 个答案:

答案 0 :(得分:0)

我们提供的信息太少,无法建议智能,因此,这是最明显的“解决方案”: DISTINCT

select DISTINCT T.Topic, ...