Java bro

Java tutorial

Sql queries

Get today name in sql

In this article we wre going write a query to get full name of today. See the below query.

Query:

SELECT TO_CHAR( TRUNC(SYSDATE),’DAY’) AS TODAY FROM DUAL ;

Output :

TODAY
MONDAY     


See the above output , trailing spaces are there . To remove the trailing spaces use the below format

Query:

SELECT TO_CHAR( TRUNC(SYSDATE),’FMDAY’) AS TODAY FROM DUAL ;

Comments are Closed

Theme by Anders Norén