【发布时间】:2018-03-19 20:25:51
【问题描述】:
我有以下查询,我需要列的唯一值
Select unique(t.id), log.*
from tableA log
inner join tableT t on t.id1=log.id1
where log.time>=(somedate)
and log.time<(somedate)
and ref-id=20
and ref-id=30
and t.id not in (select unique t.id
from tableA log
inner join tableT t on t.id1=log.id1
where log.time>=(somedate)
and log.time<(somedate)
and ref-id=20
and ref-id=30);
我没有获得 t.id 的唯一值。有人可以帮忙吗?我正在使用oracle数据库
【问题讨论】:
-
ref - id?看起来像奇怪的数学。 -
以及加入条件。
-
它是 ref_id。它是一个列
-
样本数据和期望的结果真的很有帮助。
ref_id在什么表?限定所有列引用。