SnippetLibrary

NameTagsSQL
addSubSelect
ansi
(select {{group_by_col}}, max({{max_col}}) max_{{max_col}} from {{table}} group by 1) as max_{{table}}
dayWeekMonth
postgres
date_trunc('day', {{column_name}})::date::text as "{{alias}}_day", date_trunc('week', {{column_name}})::date::text as "{{alias}}_week", date_trunc('month', {{column_name}})::date::text as "{{alias}}_month"
addWith
postgres
with {{alias}} as ( select from {{table_name}} )
Days between two dates
postgres
now()::date - some_date::date