Java bro

Java tutorial

Sql queries

Get first date of month in sql

In this article we wre going write a query to get first day of month. See the below query.

Query:

SELECT TO_CHAR( TRUNC(ADD_MONTHS(SYSDATE, 0), ‘MM’),’MM-DD-YYYY’) AS FIRST_DATE FROM DUAL ;

Output :

FIRST_DATE
03-01-2016

Comments are Closed

Theme by Anders Norén