嘿伙计们。我有一个查询:
select *
from stat.cause_code_descriptions
INNER JOIN stat.stat_dial
on stat.cause_code_descriptions.CODE = stat.stat_dial.cause
where called like '%3623.1348'
and begdt > sysdate-500
and rownum <=100
order by begdt desc
此查询返回类似的内容
login code called begdtu(unix timestamp)
oeanwel 4 VLAN:3623.1348 1336383493
oe192034 0 VLAN:3623.1348 1336382883
oe192034 2 VLAN:3623.1348 1336382640
oe192034 45 VLAN:3623.1348 1336380257
oeanwel 4 VLAN:3623.1348 1336379883
oe220850 20 VLAN:3623.1348 1336378666
oe194752 4 VLAN:3623.1348 1336378507
oeanna2510 45 VLAN:3623.1348 1336377516
oeanwel 4 VLAN:3623.1348 1336376273
oe237185 45 VLAN:3623.1348 1336374506
oe237185 4 VLAN:3623.1348 1336372662
oe237185 3 VLAN:3623.1348 1336370819
oe239364 3 VLAN:3623.1348 1336367329
oeanna2510 45 VLAN:3623.1348 1336366115
我正在寻找的是返回任何login
. 对于不重复的记录,我的查询效果很好,但对于oe192034
和oe237185
登录它会显示所有记录。我试过了group by
,distinct
但它不起作用。请帮忙