Search
 
SCRIPT & CODE EXAMPLE
 

SQL

postgresql get last day of month

SELECT (date_trunc('month', '2017-01-05'::date) + interval '1 month' - interval '1 day')::date
AS end_of_month;
Comment

postgresql get last day of month

create function end_of_month(date)
returns date as
$$
select (date_trunc('month', $1) + interval '1 month' - interval '1 day')::date;
$$ language 'sql'
immutable strict;
Comment

PREVIOUS NEXT
Code Example
Sql :: Query the list of CITY names from STATION that do not start with vowels and do not end with vowels. Your result cannot contain duplicates. 
Sql :: day of week postgresql 
Sql :: sql server get type of column 
Sql :: my sql version 
Sql :: mysql select for update ejemplo 
Sql :: get rows affected mysql python 
Sql :: get ddl materialized view oracle 
Sql :: What is the compatibility level of a SQL database 
Sql :: select insert new table sql server 
Sql :: user privileges postgresql information_schema 
Sql :: how to install mysql server on centos 7 
Sql :: mysql tinyint max value 
Sql :: base nosql 
Sql :: get all table names in sql 
Sql :: SQL server query column yes or no 
Sql :: copy one column data to another in sql 
Sql :: create row number in sql 
Sql :: datetime add 2 hours sql 
Sql :: how to delete row in sql 
Sql :: host is not allowed to connect to this mysql server 
Sql :: show all public tables postgres 
Sql :: psql client write to bash variable 
Sql :: wsl install mysql 
Sql :: sql ends with string 
Sql :: data directory postgresql 
Sql :: mysql user change password 
Sql :: update with join sql server 
Sql :: buscar nombre de columna en todas las tablas sql server 
Sql :: SQL Modify Column in a Table 
Sql :: sql where keyword contains 
ADD CONTENT
Topic
Content
Source link
Name
3+4 =