Skip to content

Commit 46aa656

Browse files
Update docs - missing changes for #754. (#884)
* Update docs. Signed-off-by: Yury-Fridlyand <[email protected]> * Reorder functions in docs aplhabetically. Signed-off-by: Yury-Fridlyand <[email protected]> Signed-off-by: Yury-Fridlyand <[email protected]>
1 parent cb1b20c commit 46aa656

File tree

2 files changed

+344
-348
lines changed

2 files changed

+344
-348
lines changed

docs/user/dql/functions.rst

Lines changed: 167 additions & 175 deletions
Original file line numberDiff line numberDiff line change
@@ -963,9 +963,103 @@ CURDATE
963963
Description
964964
>>>>>>>>>>>
965965

966-
Specifications:
966+
Returns the current time as a value in 'YYYY-MM-DD'.
967+
CURDATE() returns the time at which it executes as `SYSDATE() <#sysdate>`_ does.
968+
969+
Return type: DATE
970+
971+
Specification: CURDATE() -> DATE
972+
973+
Example::
974+
975+
> SELECT CURDATE();
976+
fetched rows / total rows = 1/1
977+
+-------------+
978+
| CURDATE() |
979+
|-------------|
980+
| 2022-08-02 |
981+
+-------------+
982+
983+
984+
CURRENT_DATE
985+
------------
986+
987+
Description
988+
>>>>>>>>>>>
989+
990+
`CURRENT_DATE` and `CURRENT_DATE()` are synonyms for `CURDATE() <#curdate>`_.
991+
992+
Example::
993+
994+
> SELECT CURRENT_DATE(), CURRENT_DATE;
995+
fetched rows / total rows = 1/1
996+
+------------------+----------------+
997+
| CURRENT_DATE() | CURRENT_DATE |
998+
|------------------+----------------|
999+
| 2022-08-02 | 2022-08-02 |
1000+
+------------------+----------------+
1001+
1002+
1003+
CURRENT_TIME
1004+
------------
1005+
1006+
Description
1007+
>>>>>>>>>>>
1008+
1009+
`CURRENT_TIME` and `CURRENT_TIME()` are synonyms for `CURTIME() <#curtime>`_.
1010+
1011+
Example::
1012+
1013+
> SELECT CURRENT_TIME(), CURRENT_TIME;
1014+
fetched rows / total rows = 1/1
1015+
+-----------------+----------------+
1016+
| CURRENT_TIME() | CURRENT_TIME |
1017+
|-----------------+----------------|
1018+
| 15:39:05 | 15:39:05 |
1019+
+-----------------+----------------+
1020+
1021+
1022+
CURRENT_TIMESTAMP
1023+
-----------------
1024+
1025+
Description
1026+
>>>>>>>>>>>
1027+
1028+
`CURRENT_TIMESTAMP` and `CURRENT_TIMESTAMP()` are synonyms for `NOW() <#now>`_.
1029+
1030+
Example::
1031+
1032+
> SELECT CURRENT_TIMESTAMP(), CURRENT_TIMESTAMP;
1033+
fetched rows / total rows = 1/1
1034+
+-----------------------+---------------------+
1035+
| CURRENT_TIMESTAMP() | CURRENT_TIMESTAMP |
1036+
|-----------------------+---------------------|
1037+
| 2022-08-02 15:54:19 | 2022-08-02 15:54:19 |
1038+
+-----------------------+---------------------+
1039+
1040+
1041+
CURTIME
1042+
-------
1043+
1044+
Description
1045+
>>>>>>>>>>>
9671046

968-
1. CURDATE() -> DATE
1047+
Returns the current time as a value in 'hh:mm:ss'.
1048+
CURTIME() returns the time at which the statement began to execute as `NOW() <#now>`_ does.
1049+
1050+
Return type: TIME
1051+
1052+
Specification: CURTIME() -> TIME
1053+
1054+
Example::
1055+
1056+
> SELECT CURTIME() as value_1, CURTIME() as value_2;
1057+
fetched rows / total rows = 1/1
1058+
+-----------+-----------+
1059+
| value_1 | value_2 |
1060+
|-----------+-----------|
1061+
| 15:39:05 | 15:39:05 |
1062+
+-----------+-----------+
9691063

9701064

9711065
DATE
@@ -1448,6 +1542,44 @@ Example::
14481542
+---------------------------+
14491543

14501544

1545+
LOCALTIMESTAMP
1546+
--------------
1547+
1548+
Description
1549+
>>>>>>>>>>>
1550+
1551+
`LOCALTIMESTAMP` and `LOCALTIMESTAMP()` are synonyms for `NOW() <#now>`_.
1552+
1553+
Example::
1554+
1555+
> SELECT LOCALTIMESTAMP(), LOCALTIMESTAMP;
1556+
fetched rows / total rows = 1/1
1557+
+---------------------+---------------------+
1558+
| LOCALTIMESTAMP() | LOCALTIMESTAMP |
1559+
|---------------------+---------------------|
1560+
| 2022-08-02 15:54:19 | 2022-08-02 15:54:19 |
1561+
+---------------------+---------------------+
1562+
1563+
1564+
LOCALTIME
1565+
---------
1566+
1567+
Description
1568+
>>>>>>>>>>>
1569+
1570+
`LOCALTIME` and `LOCALTIME()` are synonyms for `NOW() <#now>`_.
1571+
1572+
Example::
1573+
1574+
> SELECT LOCALTIME(), LOCALTIME;
1575+
fetched rows / total rows = 1/1
1576+
+---------------------+---------------------+
1577+
| LOCALTIME() | LOCALTIME |
1578+
|---------------------+---------------------|
1579+
| 2022-08-02 15:54:19 | 2022-08-02 15:54:19 |
1580+
+---------------------+---------------------+
1581+
1582+
14511583
MAKEDATE
14521584
--------
14531585

@@ -1612,7 +1744,7 @@ NOW
16121744
Description
16131745
>>>>>>>>>>>
16141746

1615-
Returns the current date and time as a value in 'YYYY-MM-DD hh:mm:ss.nnnnnn' format. The value is expressed in the cluster time zone.
1747+
Returns the current date and time as a value in 'YYYY-MM-DD hh:mm:ss' format. The value is expressed in the cluster time zone.
16161748
`NOW()` returns a constant time that indicates the time at which the statement began to execute. This differs from the behavior for `SYSDATE() <#sysdate>`_, which returns the exact time at which it executes.
16171749

16181750
Return type: DATETIME
@@ -1623,178 +1755,11 @@ Example::
16231755

16241756
> SELECT NOW() as value_1, NOW() as value_2;
16251757
fetched rows / total rows = 1/1
1626-
+----------------------------+----------------------------+
1627-
| value_1 | value_2 |
1628-
|----------------------------+----------------------------|
1629-
| 2022-08-02 15:39:05.173069 | 2022-08-02 15:39:05.173069 |
1630-
+----------------------------+----------------------------+
1631-
1632-
1633-
CURRENT_TIMESTAMP
1634-
-----------------
1635-
1636-
Description
1637-
>>>>>>>>>>>
1638-
1639-
`CURRENT_TIMESTAMP` and `CURRENT_TIMESTAMP()` are synonyms for `NOW() <#now>`_.
1640-
1641-
Example::
1642-
1643-
> SELECT CURRENT_TIMESTAMP(), CURRENT_TIMESTAMP;
1644-
fetched rows / total rows = 1/1
1645-
+----------------------------+----------------------------+
1646-
| CURRENT_TIMESTAMP() | CURRENT_TIMESTAMP |
1647-
|----------------------------+----------------------------|
1648-
| 2022-08-02 15:54:19.209361 | 2022-08-02 15:54:19.209361 |
1649-
+----------------------------+----------------------------+
1650-
1651-
1652-
LOCALTIMESTAMP
1653-
--------------
1654-
1655-
Description
1656-
>>>>>>>>>>>
1657-
1658-
`LOCALTIMESTAMP` and `LOCALTIMESTAMP()` are synonyms for `NOW() <#now>`_.
1659-
1660-
Example::
1661-
1662-
> SELECT LOCALTIMESTAMP(), LOCALTIMESTAMP;
1663-
fetched rows / total rows = 1/1
1664-
+----------------------------+----------------------------+
1665-
| LOCALTIMESTAMP() | LOCALTIMESTAMP |
1666-
|----------------------------+----------------------------|
1667-
| 2022-08-02 15:54:19.209361 | 2022-08-02 15:54:19.209361 |
1668-
+----------------------------+----------------------------+
1669-
1670-
1671-
LOCALTIME
1672-
---------
1673-
1674-
Description
1675-
>>>>>>>>>>>
1676-
1677-
`LOCALTIME` and `LOCALTIME()` are synonyms for `NOW() <#now>`_.
1678-
1679-
Example::
1680-
1681-
> SELECT LOCALTIME(), LOCALTIME;
1682-
fetched rows / total rows = 1/1
1683-
+----------------------------+----------------------------+
1684-
| LOCALTIME() | LOCALTIME |
1685-
|----------------------------+----------------------------|
1686-
| 2022-08-02 15:54:19.209361 | 2022-08-02 15:54:19.209361 |
1687-
+----------------------------+----------------------------+
1688-
1689-
1690-
SYSDATE
1691-
-------
1692-
1693-
Description
1694-
>>>>>>>>>>>
1695-
1696-
Returns the current date and time as a value in 'YYYY-MM-DD hh:mm:ss.nnnnnn'.
1697-
SYSDATE() returns the time at which it executes. This differs from the behavior for `NOW() <#now>`_, which returns a constant time that indicates the time at which the statement began to execute.
1698-
1699-
Return type: DATETIME
1700-
1701-
Specification: SYSDATE() -> DATETIME
1702-
1703-
Example::
1704-
1705-
> SELECT SYSDATE() as value_1, SYSDATE() as value_2;
1706-
fetched rows / total rows = 1/1
1707-
+----------------------------+----------------------------+
1708-
| value_1 | value_2 |
1709-
|----------------------------+----------------------------|
1710-
| 2022-08-02 15:39:05.173069 | 2022-08-02 15:39:05.173142 |
1711-
+----------------------------+----------------------------+
1712-
1713-
1714-
CURTIME
1715-
-------
1716-
1717-
Description
1718-
>>>>>>>>>>>
1719-
1720-
Returns the current time as a value in 'hh:mm:ss.nnnnnn'.
1721-
CURTIME() returns the time at which the statement began to execute as `NOW() <#now>`_ does.
1722-
1723-
Return type: TIME
1724-
1725-
Specification: CURTIME() -> TIME
1726-
1727-
Example::
1728-
1729-
> SELECT CURTIME() as value_1, CURTIME() as value_2;
1730-
fetched rows / total rows = 1/1
1731-
+-----------------+-----------------+
1732-
| value_1 | value_2 |
1733-
|-----------------+-----------------|
1734-
| 15:39:05.173069 | 15:39:05.173069 |
1735-
+-----------------+-----------------+
1736-
1737-
1738-
CURRENT_TIME
1739-
------------
1740-
1741-
Description
1742-
>>>>>>>>>>>
1743-
1744-
`CURRENT_TIME` and `CURRENT_TIME()` are synonyms for `CURTIME() <#curtime>`_.
1745-
1746-
Example::
1747-
1748-
> SELECT CURRENT_TIME(), CURRENT_TIME;
1749-
fetched rows / total rows = 1/1
1750-
+-----------------+-----------------+
1751-
| CURRENT_TIME() | CURRENT_TIME |
1752-
|-----------------+-----------------|
1753-
| 15:39:05.173069 | 15:39:05.173069 |
1754-
+-----------------+-----------------+
1755-
1756-
1757-
CURDATE
1758-
-------
1759-
1760-
Description
1761-
>>>>>>>>>>>
1762-
1763-
Returns the current time as a value in 'YYYY-MM-DD'.
1764-
CURDATE() returns the time at which it executes as `SYSDATE() <#sysdate>`_ does.
1765-
1766-
Return type: DATE
1767-
1768-
Specification: CURDATE() -> DATE
1769-
1770-
Example::
1771-
1772-
> SELECT CURDATE();
1773-
fetched rows / total rows = 1/1
1774-
+-------------+
1775-
| CURDATE() |
1776-
|-------------|
1777-
| 2022-08-02 |
1778-
+-------------+
1779-
1780-
1781-
CURRENT_DATE
1782-
------------
1783-
1784-
Description
1785-
>>>>>>>>>>>
1786-
1787-
`CURRENT_DATE` and `CURRENT_DATE()` are synonyms for `CURDATE() <#curdate>`_.
1788-
1789-
Example::
1790-
1791-
> SELECT CURRENT_DATE(), CURRENT_DATE;
1792-
fetched rows / total rows = 1/1
1793-
+------------------+----------------+
1794-
| CURRENT_DATE() | CURRENT_DATE |
1795-
|------------------+----------------|
1796-
| 2022-08-02 | 2022-08-02 |
1797-
+------------------+----------------+
1758+
+---------------------+---------------------+
1759+
| value_1 | value_2 |
1760+
|---------------------+---------------------|
1761+
| 2022-08-02 15:39:05 | 2022-08-02 15:39:05 |
1762+
+---------------------+---------------------+
17981763

17991764

18001765
QUARTER
@@ -1874,6 +1839,33 @@ Example::
18741839
+------------------------------------------------+----------------------------------+------------------------------------------------+
18751840

18761841

1842+
SYSDATE
1843+
-------
1844+
1845+
Description
1846+
>>>>>>>>>>>
1847+
1848+
Returns the current date and time as a value in 'YYYY-MM-DD hh:mm:ss[.nnnnnn]'.
1849+
SYSDATE() returns the time at which it executes. This differs from the behavior for `NOW() <#now>`_, which returns a constant time that indicates the time at which the statement began to execute.
1850+
If the argument is given, it specifies a fractional seconds precision from 0 to 6, the return value includes a fractional seconds part of that many digits.
1851+
1852+
Optional argument type: INTEGER
1853+
1854+
Return type: DATETIME
1855+
1856+
Specification: SYSDATE([INTEGER]) -> DATETIME
1857+
1858+
Example::
1859+
1860+
> SELECT SYSDATE() as value_1, SYSDATE(6) as value_2;
1861+
fetched rows / total rows = 1/1
1862+
+---------------------+----------------------------+
1863+
| value_1 | value_2 |
1864+
|---------------------+----------------------------|
1865+
| 2022-08-02 15:39:05 | 2022-08-02 15:39:05.123456 |
1866+
+---------------------+----------------------------+
1867+
1868+
18771869
TIME
18781870
----
18791871

0 commit comments

Comments
 (0)