KnowledgeTree

Bunch of Technology Solution

Date Conversion


Date is given as varchar(xx) -> 30-APR-21 00.00.00.000000 AM

Need to find the distinct of this varchar column ignoring the timestamp.

Hive Query : select DISTINCT SUBSTRING(column_name, 1, 9) from tablename where partition_year=2021 and partition_month=10 and partition_day=12;

OUTPUT: 30-APR-21