Professional Documents
Culture Documents
Screenshot 2022-09-29 at 3.51.13 AM
Screenshot 2022-09-29 at 3.51.13 AM
Syntax
Format Description
AD
AD indicator to use in conjunction with the year
A.D.
AM
A.M.
Meridian indicator
PM
P.M.
BC
BC indicator to use in conjunction with the year
B.C.
D Day of week (1-7)
DAY Name of day
DD Day of month (1-31)
DDD Day of year (1-366)
DY Abbreviated name of day
HH Hour of day (1-12)
HH24 Hour of day (0-23)
MI Minutes (0-59)
MM Month (01-12)
MON Abbreviated name of month
MONTH Name of month
RM Month in Roman Numerals (I - XII)
Accepts a 2-digit input, and returns a 4-digit year.
A value between '00' and '49' returns the year in the
RR same century.
A value between '50' and '99' returns a year in the
previous century.
Accepts a 2-digit input or a 4-digit input, and returns a
4-digit year.
For 4-digit input, the same value is returned.
RRRR
For 2 digit input, a value between '00' and '49' returns
the year in the same century, and a value between '50'
and '99' returns a year in the previous century.
SS Second (0-59)
SSSSS Seconds past midnight (0-86399)
Accepts a 1-digit input, and returns a 4-digit year in
Y
that decade.
Accepts a 2-digit input, and returns a 4-digit year in
YY
that century.
Accepts a 3-digit input, and returns a 4-digit year in
YYY
that millennium.
YYYY
Accepts a 4-digit input, and returns a 4-digits year.
SYYYY
Examples
Example 1
Result:
2010 01 05 00:00:00
Example 2
Result:
1999 01 05 00:00:00
Example 3
Result:
2005 12 12 01:00:00
Example 4
Result:
2005 04 30 01:30:00
Example 5
Result:
2099 01 05 00:00:00
Example 6
Result:
1999 01 05 00:00:00
SQL Tutorial
SQL SELECT
SQL DISTINCT
SQL WHERE
SQL AND OR
SQL IN
SQL BETWEEN
SQL Wildcard
SQL LIKE
SQL ILIKE
SQL ORDER BY
SQL GROUP BY
SQL HAVING
SQL ALIAS
SQL AS
SQL JOIN
SQL UPDATE
COMMENT
Advanced SQL
SQL UNION
SQL INTERSECT
SQL MINUS
SQL LIMIT
SQL TOP
SQL Subquery
SQL WITH
SQL EXISTS
SQL CASE
Window Functions
SQL DECODE
SQL IDENTITY
SQL Functions
SQL Average
SQL COUNT
SQL MAX
SQL MIN
SQL SUM
SQL ROUND
String Functions
SQL CAST
SQL CONVERT
SQL CONCATENATE
SQL SUBSTRING
SQL INSTR
SQL TRIM
SQL LENGTH
SQL REPLACE
SQL TO_DATE
Date Functions
SQL DDL
SQL View
SQL Index
SQL USE
SQL GRANT
SQL REVOKE
SQL CONSTRAINT
DEFAULT Constraint
UNIQUE Constraint
CHECK Constraint
PRIMARY KEY
FOREIGN KEY
Add Column
Change Column
Modify Column
Rename Column
Drop Column
Add Index
Drop Index
Add Constraint
Drop Constraint
SQL NULL
SQL Syntax
SQL Quiz
Sitemap
Resources
Cookie Policy