Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
a8c230ad
Commit
a8c230ad
authored
Aug 06, 2001
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
manual.texi added explicit entry for EXTRACT() function
Docs/manual.texi: added explicit entry for EXTRACT() function
parent
c67510f0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
8 deletions
+18
-8
Docs/manual.texi
Docs/manual.texi
+18
-8
No files found.
Docs/manual.texi
View file @
a8c230ad
...
@@ -30531,7 +30531,7 @@ mysql> select PERIOD_DIFF(9802,199703);
...
@@ -30531,7 +30531,7 @@ mysql> select PERIOD_DIFF(9802,199703);
@findex DATE_SUB()
@findex DATE_SUB()
@findex ADDDATE()
@findex ADDDATE()
@findex SUBDATE()
@findex SUBDATE()
@findex EXTRACT(
type FROM date
)
@findex EXTRACT()
@item DATE_ADD(date,INTERVAL expr type)
@item DATE_ADD(date,INTERVAL expr type)
@itemx DATE_SUB(date,INTERVAL expr type)
@itemx DATE_SUB(date,INTERVAL expr type)
@itemx ADDDATE(date,INTERVAL expr type)
@itemx ADDDATE(date,INTERVAL expr type)
...
@@ -30551,7 +30551,7 @@ or subtracted from the starting date. @code{expr} is a string; it may start
...
@@ -30551,7 +30551,7 @@ or subtracted from the starting date. @code{expr} is a string; it may start
with a @samp{-} for negative intervals. @code{type} is a keyword indicating
with a @samp{-} for negative intervals. @code{type} is a keyword indicating
how the expression should be interpreted.
how the expression should be interpreted.
The
@code{EXTRACT(type FROM date)} function
returns the 'type'
The
related function @code{EXTRACT(type FROM date)}
returns the 'type'
interval from the date.
interval from the date.
The following table shows how the @code{type} and @code{expr} arguments
The following table shows how the @code{type} and @code{expr} arguments
...
@@ -30605,12 +30605,6 @@ mysql> SELECT DATE_ADD("1998-01-01 00:00:00",
...
@@ -30605,12 +30605,6 @@ mysql> SELECT DATE_ADD("1998-01-01 00:00:00",
-> 1997-12-30 14:00:00
-> 1997-12-30 14:00:00
mysql> SELECT DATE_SUB("1998-01-02", INTERVAL 31 DAY);
mysql> SELECT DATE_SUB("1998-01-02", INTERVAL 31 DAY);
-> 1997-12-02
-> 1997-12-02
mysql> SELECT EXTRACT(YEAR FROM "1999-07-02");
-> 1999
mysql> SELECT EXTRACT(YEAR_MONTH FROM "1999-07-02 01:02:03");
-> 199907
mysql> SELECT EXTRACT(DAY_MINUTE FROM "1999-07-02 01:02:03");
-> 20102
@end example
@end example
If you specify an interval value that is too short (does not include all the
If you specify an interval value that is too short (does not include all the
...
@@ -30649,6 +30643,22 @@ mysql> select DATE_ADD('1998-01-30', Interval 1 month);
...
@@ -30649,6 +30643,22 @@ mysql> select DATE_ADD('1998-01-30', Interval 1 month);
Note from the preceding example that the word @code{INTERVAL} and the
Note from the preceding example that the word @code{INTERVAL} and the
@code{type} keyword are not case sensitive.
@code{type} keyword are not case sensitive.
@findex EXTRACT()
@item EXTRACT(type FROM date)
The @code{EXTRACT()} function uses the same kinds of interval type
specifiers as @code{DATE_ADD()} or @code{DATE_SUB()}, but extracts parts
from the date rather than performing date arithmetic.
@example
mysql> SELECT EXTRACT(YEAR FROM "1999-07-02");
-> 1999
mysql> SELECT EXTRACT(YEAR_MONTH FROM "1999-07-02 01:02:03");
-> 199907
mysql> SELECT EXTRACT(DAY_MINUTE FROM "1999-07-02 01:02:03");
-> 20102
@end example
@findex TO_DAYS()
@findex TO_DAYS()
@item TO_DAYS(date)
@item TO_DAYS(date)
Given a date @code{date}, returns a daynumber (the number of days since year
Given a date @code{date}, returns a daynumber (the number of days since year
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment