我有下面的表.Oquer工作正常,但它显示完整的重复记录。我希望所有带名称的记录单次出现
GridSplitter
查询:
<Setter Property="Height" Value="5" />
答案 0 :(得分:0)
Use DISTINCT keyword
select DISTINCT t1.* from customer t1 join (select Name, max(timestamp) as
maxstamp from customer group by Name) xx on t1.Name = xx.Name
and t1.timestamp = xx.maxstamp;
答案 1 :(得分:0)
在SQLite 3.7.11或更高版本(Android Jelly Bean或更高版本)中,您只需将MAX()与GROUP BY一起使用:
SELECT Name, Address, City, Contact, MAX(timestamp) AS timestamp
FROM Customer
GROUP BY Name;