select distinct * from (select a, '2021-01-01'::text as st, '2021-01-02'::text as lt from t)x; -- 或者: select distinct * from (select a, cast('2021-01-01' as text) as st, cast('2021-01-02' as text) as lt from t)x;