By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
CREATE TABLE T
([date] datetime, [Time] varchar(8), [place] varchar(1))
;
INSERT INTO T
([date], [Time], [place])
VALUES
('2020-07-01', '10:20:10', 'a'),
('2020-07-01', '11:20:10', 'a'),
('2020-07-01', '13:20:10', 'a'),
('2020-07-01', '10:20:10', 'b'),
('2020-07-01', '10:33:10', 'b')
;
5 rows affected
select * from T
date | Time | place |
---|---|---|
2020-07-01 00:00:00.000 | 10:20:10 | a |
2020-07-01 00:00:00.000 | 11:20:10 | a |
2020-07-01 00:00:00.000 | 13:20:10 | a |
2020-07-01 00:00:00.000 | 10:20:10 | b |
2020-07-01 00:00:00.000 | 10:33:10 | b |
select [date], max([Time]) Time, [place]
from T
group by [date], [place]
date | Time | place |
---|---|---|
2020-07-01 00:00:00.000 | 13:20:10 | a |
2020-07-01 00:00:00.000 | 10:33:10 | b |