Search
 
SCRIPT & CODE EXAMPLE
 

SQL

snowflake datetrunc month

select to_date('2015-05-08T23:39:20.123-07:00') as "DATE1",
       date_trunc('YEAR', "DATE1") as "TRUNCATED TO YEAR",
       date_trunc('MONTH', "DATE1") as "TRUNCATED TO MONTH",
       date_trunc('DAY', "DATE1") as "TRUNCATED TO DAY";
Comment

datetrunc hour snowflake

select to_timestamp('2015-05-08T23:39:20.123-07:00') as "TIMESTAMP1",
       date_trunc('HOUR', "TIMESTAMP1") as "TRUNCATED TO HOUR",
       date_trunc('MINUTE', "TIMESTAMP1") as "TRUNCATED TO MINUTE",
       date_trunc('SECOND', "TIMESTAMP1") as "TRUNCATED TO SECOND";
Comment

PREVIOUS NEXT
Code Example
Sql :: clauses in mysql 
Sql :: Windows internal database connection 
Sql :: oracle create package specification 
Sql :: get start of week big query 
Sql :: ms sql bacup table 
Sql :: t-sql update table variale 
Sql :: delete recurring email keep smallest id number 
Sql :: express api ith mysql data 
Sql :: SQL Views for Complex Queries 
Sql :: postgresql insert string 
Sql :: PSQL qith variables 
Sql :: mysql collation for case sensitive 
Sql :: acceso denegado en msql 
Sql :: SQL IN Operator With Duplicate Values 
Sql :: sql get highest date from 3 tabels 
Sql :: sütun güncelleme SQL 
Sql :: VHDL Example Code of Record Type 
Sql :: scheduled mysql database backup in linux 
Sql :: mysql user set plugin 
Sql :: sql dcl queries 
Sql :: alembic upgrade show sql 
Sql :: Filter on observations that are null SQL 
Sql :: like in openquery 
Sql :: transaction in java mysql 
Sql :: list of schema with sizes (relative and absolute) in a PostgreSQL database 
Sql :: how to combine rows in sql server procedure 
Sql :: sql get frist of month 
Sql :: select from diffrent tables 
Sql :: how to escape single quotes in SQL 
Sql :: sqlite query timer 
ADD CONTENT
Topic
Content
Source link
Name
3+7 =