What Calendar Is Used By MySQL?
934
-> 1987
•
YEARWEEK(date)
[934]
,
YEARWEEK(date,mode)
[934]
Returns year and week for a date. The
mode
argument works exactly like the
mode
argument to
WEEK()
[932]
. The year in the result may be different from the year in the date argument for the
first and the last week of the year.
mysql>
SELECT YEARWEEK('1987-01-01');
-> 198653
Note that the week number is different from what the
WEEK()
[932]
function would return (
0
) for
optional arguments
0
or
1
, as
WEEK()
[932]
then returns the week in the context of the given year.
12.8. What Calendar Is Used By MySQL?
MySQL uses what is known as a proleptic Gregorian calendar.
Every country that has switched from the Julian to the Gregorian calendar has had to discard at least
ten days during the switch. To see how this works, consider the month of October 1582, when the first
Julian-to-Gregorian switch occurred.
Monday
Tuesday
Wednesday
Thursday
Friday
Saturday
Sunday
1
2
3
4
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
There are no dates between October 4 and October 15. This discontinuity is called the cutover. Any
dates before the cutover are Julian, and any dates following the cutover are Gregorian. Dates during a
cutover are nonexistent.
A calendar applied to dates when it was not actually in use is called proleptic. Thus, if we assume there
was never a cutover and Gregorian rules always rule, we have a proleptic Gregorian calendar. This
is what is used by MySQL, as is required by standard SQL. For this reason, dates prior to the cutover
stored as MySQL
DATE
or
DATETIME
values must be adjusted to compensate for the difference. It
is important to realize that the cutover did not occur at the same time in all countries, and that the
later it happened, the more days were lost. For example, in Great Britain, it took place in 1752, when
Wednesday September 2 was followed by Thursday September 14. Russia remained on the Julian
calendar until 1918, losing 13 days in the process, and what is popularly referred to as its “October
Revolution” occurred in November according to the Gregorian calendar.
12.9. Full-Text Search Functions
MATCH (col1,col2,...) AGAINST (expr [search_modifier])
[934]
search_modifier:
{ IN BOOLEAN MODE | WITH QUERY EXPANSION }
MySQL has support for full-text indexing and searching:
• A full-text index in MySQL is an index of type
FULLTEXT
.
• Full-text indexes can be used only with
MyISAM
tables, and can be created only for
CHAR
,
VARCHAR
,
or
TEXT
columns.
• A
FULLTEXT
index definition can be given in the
CREATE TABLE
statement when a table is created,
or added later using
ALTER TABLE
or
CREATE INDEX
.
• For large data sets, it is much faster to load your data into a table that has no
FULLTEXT
index and
then create the index after that, than to load data into a table that has an existing
FULLTEXT
index.
Full-text searching is performed using
MATCH() ... AGAINST
[934]
syntax.
MATCH()
[934]
takes
a comma-separated list that names the columns to be searched.
AGAINST
takes a string to search
Содержание 5.0
Страница 1: ...MySQL 5 0 Reference Manual ...
Страница 18: ...xviii ...
Страница 60: ...40 ...
Страница 396: ...376 ...
Страница 578: ...558 ...
Страница 636: ...616 ...
Страница 844: ...824 ...
Страница 1234: ...1214 ...
Страница 1426: ...MySQL Proxy Scripting 1406 The following diagram shows an overview of the classes exposed by MySQL Proxy ...
Страница 1427: ...MySQL Proxy Scripting 1407 ...
Страница 1734: ...1714 ...
Страница 1752: ...1732 ...
Страница 1783: ...Configuring Connector ODBC 1763 ...
Страница 1793: ...Connector ODBC Examples 1773 ...
Страница 1839: ...Connector Net Installation 1819 2 You must choose the type of installation to perform ...
Страница 1842: ...Connector Net Installation 1822 5 Once the installation has been completed click Finish to exit the installer ...
Страница 1864: ...Connector Net Visual Studio Integration 1844 Figure 20 24 Debug Stepping Figure 20 25 Function Stepping 1 of 2 ...
Страница 2850: ...2830 ...
Страница 2854: ...2834 ...
Страница 2928: ...2908 ...
Страница 3000: ...2980 ...
Страница 3122: ...3102 ...
Страница 3126: ...3106 ...
Страница 3174: ...3154 ...
Страница 3232: ...3212 ...