我的查询:
SELECT sites.siteName, sites.siteIP, history.date
FROM sites INNER JOIN
history ON sites.siteName = history.siteName
ORDER BY siteName,date
Run Code Online (Sandbox Code Playgroud)
输出的第一部分:

如何删除siteName列中的重复项?我想只留下基于date列的更新版本.
在上面的示例输出中,我需要行1,3,6,10
我有一个带有三列的SQL查询.我想删除beam_current列中的任何重复值出口.如何这样做.我在sql-server2012中工作
我使用了Distinct但是我也得到了beam_current的重复值.我的sql查询是 -
select DISTINCT (beam_current), logtime, beam_energy
from INDUS2_BDS.dbo.DCCT
where logtime between '2014-08-09 01:13:03' and '2014-08-09 02:16:53'
and (beam_current like '%9.96'
or beam_current like '%9.97'
... etc ...)
and beam_energy between '550' and '552'
Run Code Online (Sandbox Code Playgroud)
EDIT-1 我的输出是 -

在第一列29.98重复三次.我只想要对应于29.98的任何一行.怎么做?