SELECT MAX(b.a) from (
select distinct * from (values (1), (1), (1), (2), (5), (1), (6)) as Y(a)
) as b
SELECT MAX(b.b) from (
select distinct * from (values (1,2), (1,3), (1,4), (2,5), (5,6), (1,7), (6,8)) as Y(a,b)
) as b
SELECT MAX(b.c) from (
select distinct * from (values (1,2,3), (1,3,4), (1,4,5), (2,5,6), (5,6,7), (1,7,8), (6,8,9)) as Y(a,b,c)
) as b
SELECT MAX(b.a) from (
select distinct * from (values ('2015-1-1'), ('2015-1-2'), ('2015-1-3'), ('2015-1-4')) as Y(a)
) as b