SQL > SQL Date Functions > Sysdate Function

The SYSDATE function is used to retrieve the current database system time in Oracle and MySQL. A common use of SYSDATE is to get today's date.

Syntax in Oracle

The syntax of SYSDATE in Oracle is simply,

SYSDATE

It does not require any argument.

Example in Oracle

The SQL statement,

SELECT SYSDATE FROM DUAL;

produces the following result when run on January 16, 2000.

SYSDATE
16-JAN-2000

Syntax in MySQL

The syntax of SYSDATE in MySQL is simply,

SYSDATE( )

It does not require an argument.

Example in MySQL

The SQL statement,

SELECT SYSDATE( );

produces the following result when run on January 16, 2000, at 09:06:22 AM.

SYSDATE
2000-01-16 09:06:22

The SQL Server equivalent of SYSDATE is GETDATE.

List of SQL Date Functions

Function NameDescription
DATEADDAdds an interval to a date value in SQL Server.
DATEDIFFCalculates the difference between two dates in MySQL and SQL Server.
DATEPARTExtracts a specific part of a date/time value in SQL Server.
GETDATERetrieves database time in SQL Server.
SYSDATERetrieves database time in Oracle and MySQL.

Next: Data Definition Language (DDL)




Copyright © 2016   1keydata.com   All Rights Reserved     Privacy Policy     About   Contact