fill_help_tables.sql
上传用户:romrleung
上传日期:2022-05-23
资源大小:18897k
文件大小:193k
源码类别:
MySQL数据库
开发平台:
Visual C++
- ","string-functions"),(185,29,"ISSIMPLE","IsSimple(g)
- Currently, this function is a placeholder and should not be used. If
- implemented, its behavior will be as described in the next paragraph.
- Returns 1 if the geometry value g has no anomalous geometric points,
- such as self-intersection or self-tangency. IsSimple() returns 0 if the
- argument is not simple, and −1 if it is NULL.
- The description of each instantiable geometric class given earlier in
- the chapter includes the specific conditions that cause an instance of
- that class to be classified as not simple.
- ","","general-geometry-property-functions"),(186,5,"- BINARY","Syntax:
- -
- Subtraction:
- ","mysql> SELECT 3-5;
- -> -2
- ","arithmetic-functions"),(187,4,"GEOMCOLLFROMTEXT","GeomCollFromText(wkt[,srid]) , GeometryCollectionFromText(wkt[,srid])
- Constructs a GEOMETRYCOLLECTION value using its WKT representation and
- SRID.
- ","","gis-wkt-functions"),(188,4,"WKT DEFINITION","The Well-Known Text (WKT) representation of Geometry is designed to
- exchange geometry data in ASCII form.
- ","","gis-wkt-format"),(189,25,"CURRENT_TIME","Syntax:
- CURRENT_TIME, CURRENT_TIME()
- CURRENT_TIME and CURRENT_TIME() are synonyms for CURTIME().
- ","","date-and-time-functions"),(190,15,"LAST_INSERT_ID","Syntax:
- LAST_INSERT_ID() LAST_INSERT_ID(expr)
- Returns the first automatically generated value that was set for an
- AUTO_INCREMENT column by the last INSERT or UPDATE query to affect such
- a column.
- ","mysql> SELECT LAST_INSERT_ID();
- -> 195
- ","information-functions"),(191,25,"LAST_DAY","Syntax:
- LAST_DAY(date)
- Takes a date or datetime value and returns the corresponding value for
- the last day of the month. Returns NULL if the argument is invalid.
- ","mysql> SELECT LAST_DAY('2003-02-05');
- -> '2003-02-28'
- mysql> SELECT LAST_DAY('2004-02-05');
- -> '2004-02-29'
- mysql> SELECT LAST_DAY('2004-01-01 01:01:01');
- -> '2004-01-31'
- mysql> SELECT LAST_DAY('2003-03-32');
- -> NULL
- ","date-and-time-functions"),(192,3,"MEDIUMINT","MEDIUMINT[(M)] [UNSIGNED] [ZEROFILL]
- A medium-size integer. The signed range is -8388608 to 8388607. The
- unsigned range is 0 to 16777215.
- ","","numeric-type-overview"),(193,5,"FLOOR","Syntax:
- FLOOR(X)
- Returns the largest integer value not greater than X.
- ","mysql> SELECT FLOOR(1.23);
- -> 1
- mysql> SELECT FLOOR(-1.23);
- -> -2
- ","mathematical-functions"),(194,30,"RTRIM","Syntax:
- RTRIM(str)
- Returns the string str with trailing space characters removed.
- ","mysql> SELECT RTRIM('barbar ');
- -> 'barbar'
- ","string-functions");
- insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (195,5,"DEGREES","Syntax:
- DEGREES(X)
- Returns the argument X, converted from radians to degrees.
- ","mysql> SELECT DEGREES(PI());
- -> 180.000000
- ","mathematical-functions"),(196,22,"EXPLAIN","Syntax:
- EXPLAIN tbl_name
- Or:
- EXPLAIN [EXTENDED] SELECT select_options
- The EXPLAIN statement can be used either as a synonym for DESCRIBE or
- as a way to obtain information about how MySQL executes a SELECT
- statement:
- o EXPLAIN tbl_name is synonymous with DESCRIBE tbl_name or SHOW COLUMNS
- FROM tbl_name.
- o When you precede a SELECT statement with the keyword EXPLAIN, MySQL
- explains how it would process the SELECT, providing information about
- how tables are joined and in which order.
- ","","explain"),(197,3,"VARCHAR","[NATIONAL] VARCHAR(M) [BINARY]
- A variable-length string. M represents the maximum column length. The
- range of M is 1 to 255 before MySQL 4.0.2, and 0 to 255 as of MySQL
- 4.0.2.
- Note: Trailing spaces are removed when VARCHAR values are stored. This
- differs from the standard SQL specification.
- In MySQL 4.1, a VARCHAR column with a length specification greater than
- 255 is converted to the smallest TEXT type that can hold values of the
- given length. For example, VARCHAR(500) is converted to TEXT, and
- VARCHAR(200000) is converted to MEDIUMTEXT. This is a compatibility
- feature. However, this conversion affects trailing-space removal.
- VARCHAR is shorthand for CHARACTER VARYING.
- As of MySQL 4.1.2, the BINARY attribute is shorthand for specifying the
- binary collation of the column character set. Sorting and comparison is
- based on numeric character values. Before 4.1.2, BINARY attribute
- causes the column to be treated as a binary string. Sorting and
- comparison is based on numeric byte values.
- ","","string-type-overview"),(198,30,"UNHEX","Syntax:
- UNHEX(str)
- Performs the opposite operation from HEX(str). That is, it interprets
- each pair of hexadecimal digits in the argument as a number and
- converts it to the character represented by the number. The resulting
- characters are returned as a binary string.
- ","mysql> SELECT UNHEX('4D7953514C');
- -> 'MySQL'
- mysql> SELECT 0x4D7953514C;
- -> 'MySQL'
- mysql> SELECT UNHEX(HEX('string'));
- -> 'string'
- mysql> SELECT HEX(UNHEX('1267'));
- -> '1267'
- ","string-functions"),(199,5,"- UNARY","Syntax:
- -
- Unary minus. Changes the sign of the argument.
- ","mysql> SELECT - 2;
- -> -2
- ","arithmetic-functions"),(200,5,"COS","Syntax:
- COS(X)
- Returns the cosine of X, where X is given in radians.
- ","mysql> SELECT COS(PI());
- -> -1.000000
- ","mathematical-functions"),(201,25,"DATE FUNCTION","Syntax:
- DATE(expr)
- Extracts the date part of the date or datetime expression expr.
- ","mysql> SELECT DATE('2003-12-31 01:02:03');
- -> '2003-12-31'
- ","date-and-time-functions"),(202,22,"RESET MASTER","Syntax:
- RESET MASTER
- Deletes all binary logs listed in the index file, resets the binary log
- index file to be empty, and creates a new binary log file.
- This statement was named FLUSH MASTER before MySQL 3.23.26.
- ","","reset-master"),(203,5,"TAN","Syntax:
- TAN(X)
- Returns the tangent of X, where X is given in radians.
- ","mysql> SELECT TAN(PI());
- -> -1.2246063538224e-16
- mysql> SELECT TAN(PI()+1);
- -> 1.5574077246549
- ","mathematical-functions"),(204,5,"PI","Syntax:
- PI()
- Returns the value of ϖ (pi). The default number of decimals displayed
- is five, but MySQL internally uses the full double-precision value.
- ","mysql> SELECT PI();
- -> 3.141593
- mysql> SELECT PI()+0.000000000000000000;
- -> 3.141592653589793116
- ","mathematical-functions"),(205,25,"WEEKOFYEAR","Syntax:
- WEEKOFYEAR(date)
- Returns the calendar week of the date as a number in the range from 1
- to 53. It is a compatibility function that is equivalent to
- WEEK(date,3).
- ","mysql> SELECT WEEKOFYEAR('1998-02-20');
- -> 8
- ","date-and-time-functions"),(206,5,"/","Syntax:
- /
- Division:
- ","mysql> SELECT 3/5;
- -> 0.60
- ","arithmetic-functions"),(207,26,"MLINEFROMWKB","MLineFromWKB(wkb[,srid]) , MultiLineStringFromWKB(wkb[,srid])
- Constructs a MULTILINESTRING value using its WKB representation and
- SRID.
- ","","gis-wkb-functions"),(208,30,"UNCOMPRESSED_LENGTH","Syntax:
- UNCOMPRESSED_LENGTH(compressed_string)
- Returns the length of a compressed string before compression.
- ","mysql> SELECT UNCOMPRESSED_LENGTH(COMPRESS(REPEAT('a',30)));
- -> 30
- ","string-functions"),(209,5,"LOG2","Syntax:
- LOG2(X)
- Returns the base-2 logarithm of X.
- ","mysql> SELECT LOG2(65536);
- -> 16.000000
- mysql> SELECT LOG2(-100);
- -> NULL
- ","mathematical-functions");
- insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (210,25,"SUBTIME","Syntax:
- SUBTIME(expr,expr2)
- SUBTIME() subtracts expr2 from expr and returns the result. expr is a
- time or datetime expression, and expr2 is a time expression.
- ","mysql> SELECT SUBTIME('1997-12-31 23:59:59.999999','1 1:1:1.000002');
- -> '1997-12-30 22:58:58.999997'
- mysql> SELECT SUBTIME('01:00:00.999999', '02:00:00.999998');
- -> '-00:59:59.999999'
- ","date-and-time-functions"),(211,32,"DROP TABLE","Syntax:
- DROP [TEMPORARY] TABLE [IF EXISTS]
- tbl_name [, tbl_name] ...
- [RESTRICT | CASCADE]
- DROP TABLE removes one or more tables. You must have the DROP privilege
- for each table. All table data and the table definition are removed, so
- be careful with this statement!
- In MySQL 3.22 or later, you can use the keywords IF EXISTS to prevent
- an error from occurring for tables that do not exist. As of MySQL 4.1,
- a NOTE is generated for each non-existent table when using IF EXISTS.
- See [show-warnings].
- RESTRICT and CASCADE are allowed to make porting easier. For the
- moment, they do nothing.
- Note: DROP TABLE automatically commits the current active transaction,
- unless you are using MySQL 4.1 or higher and the TEMPORARY keyword.
- ","","drop-table"),(212,22,"DUAL","From MySQL 4.1.0 on, you are allowed to specify DUAL as a dummy table
- name in situations where no tables are referenced:
- mysql> SELECT 1 + 1 FROM DUAL;
- -> 2
- DUAL is purely for compatibility with some other servers that require a
- FROM clause. MySQL does not require the clause if no tables are
- referenced, and the preceding statement can be written this way:
- mysql> SELECT 1 + 1;
- -> 2
- ","","select"),(213,30,"INSTR","Syntax:
- INSTR(str,substr)
- Returns the position of the first occurrence of substring substr in
- string str. This is the same as the two-argument form of LOCATE(),
- except that the order of the arguments is reversed.
- ","mysql> SELECT INSTR('foobarbar', 'bar');
- -> 4
- mysql> SELECT INSTR('xbar', 'foobar');
- -> 0
- ","string-functions"),(214,25,"NOW","Syntax:
- NOW()
- Returns the current date and time as a value in 'YYYY-MM-DD HH:MM:SS'
- or YYYYMMDDHHMMSS format, depending on whether the function is used in
- a string or numeric context.
- ","mysql> SELECT NOW();
- -> '1997-12-15 23:50:26'
- mysql> SELECT NOW() + 0;
- -> 19971215235026
- ","date-and-time-functions"),(215,17,">=","Syntax:
- >=
- Greater than or equal:
- ","mysql> SELECT 2 >= 2;
- -> 1
- ","comparison-operators"),(216,5,"EXP","Syntax:
- EXP(X)
- Returns the value of e (the base of natural logarithms) raised to the
- power of X.
- ","mysql> SELECT EXP(2);
- -> 7.389056
- mysql> SELECT EXP(-2);
- -> 0.135335
- ","mathematical-functions"),(217,10,"SHA","Syntax:
- SHA1(str) SHA(str)
- Calculates an SHA1 160-bit checksum for the string, as described in RFC
- 3174 (Secure Hash Algorithm). The value is returned as a string of 40
- hex digits, or NULL if the argument was NULL. One of the possible uses
- for this function is as a hash key. You can also use it as a
- cryptographically safe function for storing passwords.
- ","mysql> SELECT SHA1('abc');
- -> 'a9993e364706816aba3e25717850c26c9cd0d89d'
- ","encryption-functions"),(218,3,"LONGBLOB","LONGBLOB
- A BLOB column with a maximum length of 4,294,967,295 or 4GB (232 - 1)
- bytes. Up to MySQL 3.23, the client/server protocol and MyISAM tables
- had a limit of 16MB per communication packet or table row. From MySQL
- 4.0, the maximum allowed length of LONGBLOB columns depends on the
- configured maximum packet size in the client/server protocol and
- available memory.
- ","","string-type-overview"),(219,11,"POINTN","PointN(ls,n)
- Returns the n-th point in the Linestring value ls. Point numbers begin
- at 1.
- ","mysql> SET @ls = 'LineString(1 1,2 2,3 3)';
- mysql> SELECT AsText(PointN(GeomFromText(@ls),2));
- +-------------------------------------+
- | AsText(PointN(GeomFromText(@ls),2)) |
- +-------------------------------------+
- | POINT(2 2) |
- +-------------------------------------+
- ","linestring-property-functions"),(220,3,"YEAR DATA TYPE","YEAR[(2|4)]
- A year in two-digit or four-digit format. The default is four-digit
- format. In four-digit format, the allowable values are 1901 to 2155,
- and 0000. In two-digit format, the allowable values are 70 to 69,
- representing years from 1970 to 2069. MySQL displays YEAR values in
- YYYY format, but allows you to assign values to YEAR columns using
- either strings or numbers. The YEAR type is unavailable prior to MySQL
- 3.22.
- ","","date-and-time-type-overview"),(221,14,"SUM","Syntax:
- SUM(expr)
- Returns the sum of expr. If the return set has no rows, SUM() returns
- NULL.
- SUM() returns NULL if there were no matching rows.
- ","","group-by-functions"),(222,30,"OCT","Syntax:
- OCT(N)
- Returns a string representation of the octal value of N, where N is a
- longlong (BIGINT)number. This is equivalent to CONV(N,10,8). Returns
- NULL if N is NULL.
- ","mysql> SELECT OCT(12);
- -> '14'
- ","string-functions"),(223,25,"SYSDATE","Syntax:
- SYSDATE()
- Returns the current date and time as a value in 'YYYY-MM-DD HH:MM:SS'
- or YYYYMMDDHHMMSS format, depending on whether the function is used in
- a string or numeric context.
- ","","date-and-time-functions"),(224,26,"ASBINARY","AsBinary(g)
- Converts a value in internal geometry format to its WKB representation
- and returns the binary result.
- ","SELECT AsBinary(g) FROM geom;
- ","functions-to-convert-geometries-between-formats");
- insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (225,25,"MAKEDATE","Syntax:
- MAKEDATE(year,dayofyear)
- Returns a date, given year and day-of-year values. dayofyear must be
- greater than 0 or the result is NULL.
- ","mysql> SELECT MAKEDATE(2001,31), MAKEDATE(2001,32);
- -> '2001-01-31', '2001-02-01'
- mysql> SELECT MAKEDATE(2001,365), MAKEDATE(2004,365);
- -> '2001-12-31', '2004-12-30'
- mysql> SELECT MAKEDATE(2001,0);
- -> NULL
- ","date-and-time-functions"),(226,30,"BINARY OPERATOR","Syntax:
- BINARY
- The BINARY operator casts the string following it to a binary string.
- This is an easy way to force a column comparison to be done byte by
- byte rather than character by character. This causes the comparison to
- be case sensitive even if the column isn't defined as BINARY or BLOB.
- BINARY also causes trailing spaces to be significant.
- ","mysql> SELECT 'a' = 'A';
- -> 1
- mysql> SELECT BINARY 'a' = 'A';
- -> 0
- mysql> SELECT 'a' = 'a ';
- -> 1
- mysql> SELECT BINARY 'a' = 'a ';
- -> 0
- ","cast-functions"),(227,6,"MBROVERLAPS","MBROverlaps(g1,g2)
- Returns 1 or 0 to indicate whether or not the Minimum Bounding
- Rectangles of the two geometries g1 and g2 overlap.
- ","","relations-on-geometry-mbr"),(228,30,"SOUNDEX","Syntax:
- SOUNDEX(str)
- Returns a soundex string from str. Two strings that sound almost the
- same should have identical soundex strings. A standard soundex string
- is four characters long, but the SOUNDEX() function returns an
- arbitrarily long string. You can use SUBSTRING() on the result to get a
- standard soundex string. All non-alphabetic characters in str are
- ignored. All international alphabetic characters outside the A-Z range
- are treated as vowels.
- ","mysql> SELECT SOUNDEX('Hello');
- -> 'H400'
- mysql> SELECT SOUNDEX('Quadratically');
- -> 'Q36324'
- ","string-functions"),(229,22,"SHOW MASTER LOGS","Syntax:
- SHOW MASTER LOGS
- SHOW BINARY LOGS
- Lists the binary log files on the server. This statement is used as
- part of the procedure described in [purge-master-logs] for determining
- which logs can be purged.
- mysql> SHOW BINARY LOGS;
- +---------------+-----------+
- | Log_name | File_size |
- +---------------+-----------+
- | binlog.000015 | 724935 |
- | binlog.000016 | 733481 |
- +---------------+-----------+
- ","","show-master-logs"),(230,6,"MBRTOUCHES","MBRTouches(g1,g2)
- Returns 1 or 0 to indicate whether or not the Minimum Bounding
- Rectangles of the two geometries g1 and g2 touch.
- ","","relations-on-geometry-mbr"),(231,22,"INSERT SELECT","Syntax:
- INSERT [LOW_PRIORITY | HIGH_PRIORITY] [IGNORE]
- [INTO] tbl_name [(col_name,...)]
- SELECT ...
- [ ON DUPLICATE KEY UPDATE col_name=expr, ... ]
- With INSERT ... SELECT, you can quickly insert many rows into a table
- from one or many tables.
- ","INSERT INTO tbl_temp2 (fld_id)
- SELECT tbl_temp1.fld_order_id
- FROM tbl_temp1 WHERE tbl_temp1.fld_order_id > 100;
- ","insert-select"),(232,3,"VARBINARY","VARBINARY(M)
- The VARBINARY type is similar to the VARCHAR type, but stores binary
- byte strings rather than non-binary character strings.
- This type was added in MySQL 4.1.2.
- ","","string-type-overview"),(233,22,"LOAD INDEX","Syntax:
- LOAD INDEX INTO CACHE
- tbl_index_list [, tbl_index_list] ...
- tbl_index_list:
- tbl_name
- [[INDEX|KEY] (index_name[, index_name] ...)]
- [IGNORE LEAVES]
- The LOAD INDEX INTO CACHE statement preloads a table index into the key
- cache to which it has been assigned by an explicit CACHE INDEX
- statement, or into the default key cache otherwise. LOAD INDEX INTO
- CACHE is used only for MyISAM tables.
- The IGNORE LEAVES modifier causes only blocks for the non-leaf nodes of
- the index to be preloaded.
- ","","load-index"),(234,22,"UNION","Syntax:
- SELECT ...
- UNION [ALL | DISTINCT]
- SELECT ...
- [UNION [ALL | DISTINCT]
- SELECT ...]
- UNION is used to combine the result from a number of SELECT statements
- into one result set. UNION is available from MySQL 4.0.0 on.
- Selected columns listed in corresponding positions of each SELECT
- statement should have the same type. (For example, the first column
- selected by the first statement should have the same type as the first
- column selected by the other statements.) The column names used in the
- first SELECT statement are used as the column names for the results
- returned.
- ","","union"),(235,25,"TO_DAYS","Syntax:
- TO_DAYS(date)
- Given a date date, returns a daynumber (the number of days since year
- 0).
- ","mysql> SELECT TO_DAYS(950501);
- -> 728779
- mysql> SELECT TO_DAYS('1997-10-07');
- -> 729669
- ","date-and-time-functions"),(236,30,"NOT REGEXP","Syntax:
- expr NOT REGEXP pat expr NOT RLIKE pat
- This is the same as NOT (expr REGEXP pat).
- ","","string-comparison-functions"),(237,17,"NOT IN","Syntax:
- expr NOT IN (value,...)
- This is the same as NOT (expr IN (value,...)).
- ","","comparison-operators"),(238,12,"!","Syntax:
- NOT, !
- Logical NOT. Evaluates to 1 if the operand is 0, to 0 if the operand is
- non-zero, and NOT NULL returns NULL.
- ","mysql> SELECT NOT 10;
- -> 0
- mysql> SELECT NOT 0;
- -> 1
- mysql> SELECT NOT NULL;
- -> NULL
- mysql> SELECT ! (1+1);
- -> 0
- mysql> SELECT ! 1+1;
- -> 1
- ","logical-operators"),(239,3,"DOUBLE","DOUBLE[(M,D)] [UNSIGNED] [ZEROFILL]
- A normal-size (double-precision) floating-point number. Allowable
- values are -1.7976931348623157E+308 to -2.2250738585072014E-308, 0, and
- 2.2250738585072014E-308 to 1.7976931348623157E+308. These are the
- theoretical limits, based on the IEEE standard. The actual range might
- be slightly smaller depending on your hardware or operating system.
- M is the total number of decimal digits and D is the number of digits
- following the decimal point. If M and D are omitted, values are stored
- to the limits allowed by the hardware. A double-precision
- floating-point number is accurate to approximately 15 decimal places.
- If UNSIGNED is specified, negative values are disallowed.
- ","","numeric-type-overview");
- insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (240,3,"TIME","TIME
- A time. The range is '-838:59:59' to '838:59:59'. MySQL displays TIME
- values in 'HH:MM:SS' format, but allows you to assign values to TIME
- columns using either strings or numbers.
- ","","date-and-time-type-overview"),(241,12,"&&","Syntax:
- AND, &&
- Logical AND. Evaluates to 1 if all operands are non-zero and not NULL,
- to 0 if one or more operands are 0, otherwise NULL is returned.
- ","mysql> SELECT 1 && 1;
- -> 1
- mysql> SELECT 1 && 0;
- -> 0
- mysql> SELECT 1 && NULL;
- -> NULL
- mysql> SELECT 0 && NULL;
- -> 0
- mysql> SELECT NULL && 0;
- -> 0
- ","logical-operators"),(242,9,"X","X(p)
- Returns the X-coordinate value for the point p as a double-precision
- number.
- ","mysql> SELECT X(GeomFromText('Point(56.7 53.34)'));
- +--------------------------------------+
- | X(GeomFromText('Point(56.7 53.34)')) |
- +--------------------------------------+
- | 56.7 |
- +--------------------------------------+
- ","point-property-functions"),(243,15,"FOUND_ROWS","Syntax:
- FOUND_ROWS()
- A SELECT statement may include a LIMIT clause to restrict the number of
- rows the server returns to the client. In some cases, it is desirable
- to know how many rows the statement would have returned without the
- LIMIT, but without running the statement again. To get this row count,
- include a SQL_CALC_FOUND_ROWS option in the SELECT statement, then
- invoke FOUND_ROWS() afterward:
- ","mysql> SELECT SQL_CALC_FOUND_ROWS * FROM tbl_name
- -> WHERE id > 100 LIMIT 10;
- mysql> SELECT FOUND_ROWS();
- ","information-functions"),(244,15,"SYSTEM_USER","Syntax:
- SYSTEM_USER()
- SYSTEM_USER() is a synonym for USER().
- ","","information-functions"),(245,24,"CROSSES","Crosses(g1,g2)
- Returns 1 if g1 spatially crosses g2. Returns NULL if g1 is a Polygon
- or a MultiPolygon, or if g2 is a Point or a MultiPoint. Otherwise,
- returns 0.
- The term spatially crosses denotes a spatial relation between two given
- geometries that has the following properties:
- o The two geometries intersect
- o Their intersection results in a geometry that has a dimension that is
- one less than the maximum dimension of the two given geometries
- o Their intersection is not equal to either of the two given geometries
- ","","functions-that-test-spatial-relationships-between-geometries"),(246,22,"TRUNCATE TABLE","Syntax:
- TRUNCATE [TABLE] tbl_name
- TRUNCATE TABLE empties a table completely. Logically, this is
- equivalent to a DELETE statement that deletes all rows, but there are
- practical differences under some circumstances.
- For InnoDB, TRUNCATE TABLE is mapped to DELETE, so there is no
- difference.
- For other storage engines, TRUNCATE TABLE differs from DELETE FROM in
- the following ways from MySQL 4.0 onwards:
- o Truncate operations drop and re-create the table, which is much
- faster than deleting rows one by one.
- o Truncate operations are not transaction-safe; an error occurs when
- attempting one in the course of an active transaction or active table
- lock.
- o The number of deleted rows is not returned.
- o As long as the table definition file tbl_name.frm is valid, the table
- can be re-created as an empty table with TRUNCATE TABLE, even if the
- data or index files have become corrupted.
- o The table handler does not remember the last used AUTO_INCREMENT
- value, but starts counting from the beginning. This is true even for
- MyISAM and InnoDB, which normally do not reuse sequence values.
- In MySQL 3.23, TRUNCATE TABLE is mapped to COMMIT; DELETE FROM
- tbl_name, so it behaves like DELETE. See [delete].
- TRUNCATE TABLE is an Oracle SQL extension. This statement was added in
- MySQL 3.23.28, although from 3.23.28 to 3.23.32, the keyword TABLE must
- be omitted.
- ","","truncate"),(247,25,"CURRENT_DATE","Syntax:
- CURRENT_DATE CURRENT_DATE()
- CURRENT_DATE and CURRENT_DATE() are synonyms for CURDATE().
- ","","date-and-time-functions"),(248,14,"BIT_XOR","Syntax:
- BIT_XOR(expr)
- Returns the bitwise XOR of all bits in expr. The calculation is
- performed with 64-bit (BIGINT) precision.
- ","","group-by-functions"),(249,2,"AREA","Area(poly)
- Returns as a double-precision number the area of the Polygon value
- poly, as measured in its spatial reference system.
- ","mysql> SET @poly = 'Polygon((0 0,0 3,3 0,0 0),(1 1,1 2,2 1,1 1))';
- mysql> SELECT Area(GeomFromText(@poly));
- +---------------------------+
- | Area(GeomFromText(@poly)) |
- +---------------------------+
- | 4 |
- +---------------------------+
- ","polygon-property-functions"),(250,22,"START SLAVE","Syntax:
- START SLAVE [thread_type [, thread_type] ... ]
- START SLAVE [SQL_THREAD] UNTIL
- MASTER_LOG_FILE = 'log_name', MASTER_LOG_POS = log_pos
- START SLAVE [SQL_THREAD] UNTIL
- RELAY_LOG_FILE = 'log_name', RELAY_LOG_POS = log_pos
- thread_type: IO_THREAD | SQL_THREAD
- START SLAVE with no options starts both of the slave threads. The I/O
- thread reads queries from the master server and stores them in the
- relay log. The SQL thread reads the relay log and executes the queries.
- START SLAVE requires the SUPER privilege.
- If START SLAVE succeeds in starting the slave threads, it returns
- without any error. However, even in that case, it might be that the
- slave threads start and then later stop (for example, because they do
- not manage to connect to the master or read its binary logs, or some
- other problem). START SLAVE does not warn you about this. You must
- check the slave's error log for error messages generated by the slave
- threads, or check that they are running satisfactorilly with SHOW SLAVE
- STATUS.
- ","","start-slave"),(251,22,"FLUSH","Syntax:
- FLUSH [LOCAL | NO_WRITE_TO_BINLOG] flush_option [, flush_option] ...
- You should use the FLUSH statement if you want to clear some of the
- internal caches MySQL uses. To execute FLUSH, you must have the RELOAD
- privilege.
- ","","flush"),(252,21,"DESCRIBE","Syntax:
- {DESCRIBE | DESC} tbl_name [col_name | wild]
- DESCRIBE provides information about the columns in a table. It is a
- shortcut for SHOW COLUMNS FROM.
- ","","describe"),(253,21,"DROP USER","Syntax:
- DROP USER user [, user] ...
- The DROP USER statement deletes one or more MySQL accounts. To use it,
- you must have the global CREATE USER privilege or the DELETE privilege
- for the mysql database. Each account is named using the same format as
- for GRANT or REVOKE; for example, 'jeffrey'@'localhost'. The user and
- host parts of the account name correspond to the User and Host column
- values of the user table record for the account.
- ","","drop-user"),(254,30,"SUBSTRING","Syntax:
- SUBSTRING(str,pos) , SUBSTRING(str FROM pos) SUBSTRING(str,pos,len) ,
- SUBSTRING(str FROM pos FOR len)
- The forms without a len argument return a substring from string str
- starting at position pos. The forms with a len argument return a
- substring len characters long from string str, starting at position
- pos. The forms that use FROM are standard SQL syntax. Beginning with
- MySQL 4.1.0, it is possible to use a negative value for pos. In this
- case, the beginning of the substring is pos characters from the end of
- the string, rather than the beginning. A negative value may be used for
- pos in any of the forms of this function.
- ","mysql> SELECT SUBSTRING('Quadratically',5);
- -> 'ratically'
- mysql> SELECT SUBSTRING('foobarbar' FROM 4);
- -> 'barbar'
- mysql> SELECT SUBSTRING('Quadratically',5,6);
- -> 'ratica'
- mysql> SELECT SUBSTRING('Sakila', -3);
- -> 'ila'
- mysql> SELECT SUBSTRING('Sakila', -5, 3);
- -> 'aki'
- mysql> SELECT SUBSTRING('Sakila' FROM -4 FOR 2);
- -> 'ki'
- ","string-functions");
- insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (255,29,"ISEMPTY","IsEmpty(g)
- Returns 1 if the geometry value g is the empty geometry, 0 if it is not
- empty, and −1 if the argument is NULL. If the geometry is empty, it
- represents the empty point set.
- ","","general-geometry-property-functions"),(256,30,"LTRIM","Syntax:
- LTRIM(str)
- Returns the string str with leading space characters removed.
- ","mysql> SELECT LTRIM(' barbar');
- -> 'barbar'
- ","string-functions"),(257,24,"INTERSECTS","Intersects(g1,g2)
- Returns 1 or 0 to indicate whether or not g1 spatially intersects g2.
- ","","functions-that-test-spatial-relationships-between-geometries"),(258,6,"MBRDISJOINT","MBRDisjoint(g1,g2)
- Returns 1 or 0 to indicate whether or not the Minimum Bounding
- Rectangles of the two geometries g1 and g2 are disjoint (do not
- intersect).
- ","","relations-on-geometry-mbr"),(259,13,"VALUES","Syntax:
- VALUES(col_name)
- In an INSERT ... ON DUPLICATE KEY UPDATE ... statement, you can use the
- VALUES(col_name) function in the UPDATE clause to refer to column
- values from the INSERT portion of the statement. In other words,
- VALUES(col_name) in the UPDATE clause refers to the value of col_name
- that would be inserted, had no duplicate-key conflict occurred. This
- function is especially useful in multiple-row inserts. The VALUES()
- function is meaningful only in INSERT ... UPDATE statements and returns
- NULL otherwise. [insert].
- ","mysql> INSERT INTO table (a,b,c) VALUES (1,2,3),(4,5,6)
- -> ON DUPLICATE KEY UPDATE c=VALUES(a)+VALUES(b);
- ","miscellaneous-functions"),(260,30,"SUBSTRING_INDEX","Syntax:
- SUBSTRING_INDEX(str,delim,count)
- Returns the substring from string str before count occurrences of the
- delimiter delim. If count is positive, everything to the left of the
- final delimiter (counting from the left) is returned. If count is
- negative, everything to the right of the final delimiter (counting from
- the right) is returned. SUBSTRING_INDEX() performs a case-sensitive
- match when searching for delim.
- ","mysql> SELECT SUBSTRING_INDEX('www.mysql.com', '.', 2);
- -> 'www.mysql'
- mysql> SELECT SUBSTRING_INDEX('www.mysql.com', '.', -2);
- -> 'mysql.com'
- ","string-functions"),(261,10,"ENCODE","Syntax:
- ENCODE(str,pass_str)
- Encrypt str using pass_str as the password. To decrypt the result, use
- DECODE().
- The result is a binary string of the same length as str. If you want to
- save it in a column, use a BLOB column type.
- ","","encryption-functions"),(262,5,"TRUNCATE","Syntax:
- TRUNCATE(X,D)
- Returns the number X, truncated to D decimals. If D is 0, the result
- has no decimal point or fractional part. D can be negative in order to
- truncate (make zero) D digits left of the decimal point of the value X.
- ","mysql> SELECT TRUNCATE(1.223,1);
- -> 1.2
- mysql> SELECT TRUNCATE(1.999,1);
- -> 1.9
- mysql> SELECT TRUNCATE(1.999,0);
- -> 1
- mysql> SELECT TRUNCATE(-1.999,1);
- -> -1.9
- mysql> SELECT TRUNCATE(122,-2);
- -> 100
- mysql> SELECT TRUNCATE(10.28*100,0);
- -> 1027
- ","mathematical-functions"),(263,22,"SHOW","SHOW has many forms that provide information about databases, tables,
- columns, or status information about the server. This section describes
- those following:
- SHOW [FULL] COLUMNS FROM tbl_name [FROM db_name] [LIKE 'pattern']
- SHOW CREATE DATABASE db_name
- SHOW CREATE TABLE tbl_name
- SHOW DATABASES [LIKE 'pattern']
- SHOW ENGINE engine_name {LOGS | STATUS }
- SHOW [STORAGE] ENGINES
- SHOW ERRORS [LIMIT [offset,] row_count]
- SHOW GRANTS FOR user
- SHOW INDEX FROM tbl_name [FROM db_name]
- SHOW INNODB STATUS
- SHOW [BDB] LOGS
- SHOW PRIVILEGES
- SHOW [FULL] PROCESSLIST
- SHOW [GLOBAL | SESSION] STATUS [LIKE 'pattern']
- SHOW TABLE STATUS [FROM db_name] [LIKE 'pattern']
- SHOW [OPEN] TABLES [FROM db_name] [LIKE 'pattern']
- SHOW [GLOBAL | SESSION] VARIABLES [LIKE 'pattern']
- SHOW WARNINGS [LIMIT [offset,] row_count]
- The SHOW statement also has forms that provide information about
- replication master and slave servers and are described in
- [replication-sql]:
- SHOW BINLOG EVENTS
- SHOW MASTER LOGS
- SHOW MASTER STATUS
- SHOW SLAVE HOSTS
- SHOW SLAVE STATUS
- If the syntax for a given SHOW statement includes a LIKE 'pattern'
- part, 'pattern' is a string that can contain the SQL `%' and `_'
- wildcard characters. The pattern is useful for restricting statement
- output to matching values.
- ","","show"),(264,17,"GREATEST","Syntax:
- GREATEST(value1,value2,...)
- With two or more arguments, returns the largest (maximum-valued)
- argument. The arguments are compared using the same rules as for
- LEAST().
- ","mysql> SELECT GREATEST(2,0);
- -> 2
- mysql> SELECT GREATEST(34.0,3.0,5.0,767.0);
- -> 767.0
- mysql> SELECT GREATEST('B','A','C');
- -> 'C'
- ","comparison-operators"),(265,30,"OCTETLENGTH","Syntax:
- OCTET_LENGTH(str)
- OCTET_LENGTH() is a synonym for LENGTH().
- ","","string-functions"),(266,25,"SECOND","Syntax:
- SECOND(time)
- Returns the second for time, in the range 0 to 59.
- ","mysql> SELECT SECOND('10:05:03');
- -> 3
- ","date-and-time-functions"),(267,14,"BIT_AND","Syntax:
- BIT_AND(expr)
- Returns the bitwise AND of all bits in expr. The calculation is
- performed with 64-bit (BIGINT) precision.
- ","","group-by-functions"),(268,5,"ATAN2","Syntax:
- ATAN(Y,X) , ATAN2(Y,X)
- Returns the arc tangent of the two variables X and Y. It is similar to
- calculating the arc tangent of Y / X, except that the signs of both
- arguments are used to determine the quadrant of the result.
- ","mysql> SELECT ATAN(-2,2);
- -> -0.785398
- mysql> SELECT ATAN2(PI(),0);
- -> 1.570796
- ","mathematical-functions"),(269,6,"MBRCONTAINS","MBRContains(g1,g2)
- Returns 1 or 0 to indicate whether or not the Minimum Bounding
- Rectangle of g1 contains the Minimum Bounding Rectangle of g2.
- ","mysql> SET @g1 = GeomFromText('Polygon((0 0,0 3,3 3,3 0,0 0))');
- mysql> SET @g2 = GeomFromText('Point(1 1)');
- mysql> SELECT MBRContains(@g1,@g2), MBRContains(@g2,@g1);
- ----------------------+----------------------+
- | MBRContains(@g1,@g2) | MBRContains(@g2,@g1) |
- +----------------------+----------------------+
- | 1 | 0 |
- +----------------------+----------------------+
- ","relations-on-geometry-mbr");
- insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (270,25,"HOUR","Syntax:
- HOUR(time)
- Returns the hour for time. The range of the return value is 0 to 23 for
- time-of-day values.
- ","mysql> SELECT HOUR('10:05:03');
- -> 10
- ","date-and-time-functions"),(271,22,"SELECT","Syntax:
- SELECT
- [ALL | DISTINCT | DISTINCTROW ]
- [HIGH_PRIORITY]
- [STRAIGHT_JOIN]
- [SQL_SMALL_RESULT] [SQL_BIG_RESULT] [SQL_BUFFER_RESULT]
- [SQL_CACHE | SQL_NO_CACHE] [SQL_CALC_FOUND_ROWS]
- select_expr, ...
- [INTO OUTFILE 'file_name' export_options
- | INTO DUMPFILE 'file_name']
- [FROM table_references
- [WHERE where_definition]
- [GROUP BY {col_name | expr | position}
- [ASC | DESC], ... [WITH ROLLUP]]
- [HAVING where_definition]
- [ORDER BY {col_name | expr | position}
- [ASC | DESC] , ...]
- [LIMIT {[offset,] row_count | row_count OFFSET offset}]
- [PROCEDURE procedure_name(argument_list)]
- [FOR UPDATE | LOCK IN SHARE MODE]]
- SELECT is used to retrieve rows selected from one or more tables.
- Support for UNION statements and subqueries is available as of MySQL
- 4.0 and 4.1, respectively. See [union] and [subqueries].
- o Each select_expr indicates a column you want to retrieve.
- o table_references indicates the table or tables from which to retrieve
- rows. Its syntax is described in [join].
- o where_definition consists of the keyword WHERE followed by an
- expression that indicates the condition or conditions that rows must
- satisfy to be selected.
- SELECT can also be used to retrieve rows computed without reference to
- any table.
- ","","select"),(272,5,"COT","Syntax:
- COT(X)
- Returns the cotangent of X.
- ","mysql> SELECT COT(12);
- -> -1.57267341
- mysql> SELECT COT(0);
- -> NULL
- ","mathematical-functions"),(273,21,"BACKUP TABLE","Syntax:
- BACKUP TABLE tbl_name [, tbl_name] ... TO '/path/to/backup/directory'
- Note: This statement is deprecated. We are working on a better
- replacement for it that will provide online backup capabilities. In the
- meantime, the mysqlhotcopy script can be used instead.
- BACKUP TABLE copies to the backup directory the minimum number of table
- files needed to restore the table, after flushing any buffered changes
- to disk. The statement works only for MyISAM tables. It copies the .frm
- definition and .MYD data files. The .MYI index file can be rebuilt from
- those two files. The directory should be specified as a full pathname.
- ","","backup-table"),(274,30,"LOAD_FILE","Syntax:
- LOAD_FILE(file_name)
- Reads the file and returns the file contents as a string. The file must
- be located on the server, you must specify the full pathname to the
- file, and you must have the FILE privilege. The file must be readable
- by all and its size less than max_allowed_packet bytes.
- If the file does not exist or cannot be read because one of the
- preceding conditions is not satisfied, the function returns NULL.
- ","mysql> UPDATE tbl_name
- SET blob_column=LOAD_FILE('/tmp/picture')
- WHERE id=1;
- ","string-functions"),(275,4,"POINTFROMTEXT","PointFromText(wkt[,srid])
- Constructs a POINT value using its WKT representation and SRID.
- ","","gis-wkt-functions"),(276,22,"LOAD TABLE FROM MASTER","Syntax:
- LOAD TABLE tbl_name FROM MASTER
- Transfers a copy of the table from the master to the slave. This
- statement is implemented mainly for debugging of LOAD DATA FROM MASTER.
- It requires that the account used for connecting to the master server
- has the RELOAD and SUPER privileges on the master and the SELECT
- privilege on the master table to load. On the slave side, the user that
- issues LOAD TABLE FROM MASTER should have privileges to drop and create
- the table.
- The conditions for LOAD DATA FROM MASTER apply here as well. For
- example, LOAD TABLE FROM MASTER works only for MyISAM tables. The
- timeout notes for LOAD DATA FROM MASTER apply as well.
- ","","load-table-from-master"),(277,14,"GROUP_CONCAT","Syntax:
- GROUP_CONCAT(expr)
- This function returns a string result with the concatenated non-NULL
- values from a group. It returns NULL if there are no non-NULL values.
- The full syntax is as follows:
- GROUP_CONCAT([DISTINCT] expr [,expr ...]
- [ORDER BY {unsigned_integer | col_name | expr}
- [ASC | DESC] [,col_name ...]]
- [SEPARATOR str_val])
- ","mysql> SELECT student_name,
- -> GROUP_CONCAT(test_score)
- -> FROM student
- -> GROUP BY student_name;
- ","group-by-functions"),(278,25,"DATE_FORMAT","Syntax:
- DATE_FORMAT(date,format)
- Formats the date value according to the format string.
- ","mysql> SELECT DATE_FORMAT('1997-10-04 22:23:00', '%W %M %Y');
- -> 'Saturday October 1997'
- mysql> SELECT DATE_FORMAT('1997-10-04 22:23:00', '%H:%i:%s');
- -> '22:23:00'
- mysql> SELECT DATE_FORMAT('1997-10-04 22:23:00',
- '%D %y %a %d %m %b %j');
- -> '4th 97 Sat 04 10 Oct 277'
- mysql> SELECT DATE_FORMAT('1997-10-04 22:23:00',
- '%H %k %I %r %T %S %w');
- -> '22 22 10 10:23:00 PM 22:23:00 00 6'
- mysql> SELECT DATE_FORMAT('1999-01-01', '%X %V');
- -> '1998 52'
- ","date-and-time-functions"),(279,15,"BENCHMARK","Syntax:
- BENCHMARK(count,expr)
- The BENCHMARK() function executes the expression expr repeatedly count
- times. It may be used to time how quickly MySQL processes the
- expression. The result value is always 0. The intended use is from
- within the mysql client, which reports query execution times:
- ","mysql> SELECT BENCHMARK(1000000,ENCODE('hello','goodbye'));
- +----------------------------------------------+
- | BENCHMARK(1000000,ENCODE('hello','goodbye')) |
- +----------------------------------------------+
- | 0 |
- +----------------------------------------------+
- 1 row in set (4.74 sec)
- ","information-functions"),(280,25,"YEAR","Syntax:
- YEAR(date)
- Returns the year for date, in the range 1000 to 9999.
- ","mysql> SELECT YEAR('98-02-03');
- -> 1998
- ","date-and-time-functions"),(281,22,"SHOW ENGINE","Syntax:
- SHOW ENGINE engine_name {LOGS | STATUS }
- SHOW ENGINE displays log or status information about storage engines.
- The following statements currently are supported:
- SHOW ENGINE BDB LOGS
- SHOW ENGINE INNODB STATUS
- ","","show-engine"),(282,13,"RELEASE_LOCK","Syntax:
- RELEASE_LOCK(str)
- Releases the lock named by the string str that was obtained with
- GET_LOCK(). Returns 1 if the lock was released, 0 if the lock was not
- established by this thread (in which case the lock is not released),
- and NULL if the named lock did not exist. The lock does not exist if it
- was never obtained by a call to GET_LOCK() or if it has previously been
- released.
- The DO statement is convenient to use with RELEASE_LOCK(). See [do].
- ","","miscellaneous-functions"),(283,17,"IS NULL","Syntax:
- IS NULL, IS NOT NULL
- Tests whether a value is or is not NULL.
- ","mysql> SELECT 1 IS NULL, 0 IS NULL, NULL IS NULL;
- -> 0, 0, 1
- mysql> SELECT 1 IS NOT NULL, 0 IS NOT NULL, NULL IS NOT NULL;
- -> 1, 1, 0
- ","comparison-operators"),(284,25,"CONVERT_TZ","Syntax:
- CONVERT_TZ(dt,from_tz,to_tz)
- CONVERT_TZ() converts a datetime value dt from time zone given by
- from_tz to the time zone given by to_tz and returns the resulting
- value. Time zones may be specified as described in [time-zone-support].
- This function returns NULL if the arguments are invalid.
- ","mysql> SELECT CONVERT_TZ('2004-01-01 12:00:00','GMT','MET');
- -> '2004-01-01 13:00:00'
- mysql> SELECT CONVERT_TZ('2004-01-01 12:00:00','+00:00','+10:00');
- -> '2004-01-01 22:00:00'
- ","date-and-time-functions");
- insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (285,25,"TIME_TO_SEC","Syntax:
- TIME_TO_SEC(time)
- Returns the time argument, converted to seconds.
- ","mysql> SELECT TIME_TO_SEC('22:23:00');
- -> 80580
- mysql> SELECT TIME_TO_SEC('00:39:38');
- -> 2378
- ","date-and-time-functions"),(286,25,"WEEKDAY","Syntax:
- WEEKDAY(date)
- Returns the weekday index for date (0 = Monday, 1 = Tuesday, ... 6 =
- Sunday).
- ","mysql> SELECT WEEKDAY('1998-02-03 22:23:00');
- -> 1
- mysql> SELECT WEEKDAY('1997-11-05');
- -> 2
- ","date-and-time-functions"),(287,30,"EXPORT_SET","Syntax:
- EXPORT_SET(bits,on,off[,separator[,number_of_bits]])
- Returns a string in which for every bit set in the value bits, you get
- an on string and for every reset bit you get an off string. Bits in
- bits are examined from right to left (from low-order to high-order
- bits). Strings are added to the result from left to right, separated by
- the separator string (the default being the comma character `,'). The
- number of bits examined is given by number_of_bits (defaults to 64).
- ","mysql> SELECT EXPORT_SET(5,'Y','N',',',4);
- -> 'Y,N,Y,N'
- mysql> SELECT EXPORT_SET(6,'1','0',',',10);
- -> '0,1,1,0,0,0,0,0,0,0'
- ","string-functions"),(288,25,"TIME FUNCTION","Syntax:
- TIME(expr)
- Extracts the time part of the time or datetime expression expr and
- returns it as a string.
- ","mysql> SELECT TIME('2003-12-31 01:02:03');
- -> '01:02:03'
- mysql> SELECT TIME('2003-12-31 01:02:03.000123');
- -> '01:02:03.000123'
- ","date-and-time-functions"),(289,30,"CAST","Syntax:
- CAST(expr AS type), CONVERT(expr,type) , CONVERT(expr USING
- transcoding_name)
- The CAST() and CONVERT() functions can be used to take a value of one
- type and produce a value of another type.
- The type can be one of the following values:
- o BINARY (and BINARY[N] as of MySQL 4.1.1)
- o CHAR (and CHAR[N] as of MySQL 4.1.1)
- o DATE
- o DATETIME
- o SIGNED [INTEGER]
- o TIME
- o UNSIGNED [INTEGER]
- BINARY produces a binary string. See the entry for the BINARY operator
- in this section for a description of how this affects comparisons.
- If the optional length N is given, BINARY[N] causes the cast to use no
- more than N bytes of the argument. Similarly, CHAR[N] causes the cast
- to use no more than N characters of the argument.
- CAST() and CONVERT() are available as of MySQL 4.0.2. The CHAR
- conversion type is available as of 4.0.6. The USING form of CONVERT()
- is available as of 4.1.0.
- CAST() and CONVERT(... USING ...) are standard SQL syntax. The
- non-USING form of CONVERT() is ODBC syntax.
- CONVERT() with USING is used to convert data between different
- character sets. In MySQL, transcoding names are the same as the
- corresponding character set names. For example, this statement converts
- the string 'abc' in the server's default character set to the
- corresponding string in the utf8 character set:
- SELECT CONVERT('abc' USING utf8);
- ","SELECT enum_col FROM tbl_name ORDER BY CAST(enum_col AS CHAR);
- ","cast-functions"),(290,30,"SOUNDS LIKE","Syntax:
- expr1 SOUNDS LIKE expr2
- This is the same as SOUNDEX(expr1) = SOUNDEX(expr2). It is available
- beginning with MySQL 4.1.0.
- ","","string-functions"),(291,25,"PERIOD_DIFF","Syntax:
- PERIOD_DIFF(P1,P2)
- Returns the number of months between periods P1 and P2. P1 and P2
- should be in the format YYMM or YYYYMM. Note that the period arguments
- P1 and P2 are not date values.
- ","mysql> SELECT PERIOD_DIFF(9802,199703);
- -> 11
- ","date-and-time-functions"),(292,30,"LIKE","Syntax:
- expr LIKE pat [ESCAPE 'escape-char']
- Pattern matching using SQL simple regular expression comparison.
- Returns 1 (TRUE) or 0 (FALSE). If either expr or pat is NULL, the
- result is NULL.
- The pattern need not be a literal string. For example, it can be
- specified as a string expression or table column.
- ","mysql> SELECT 'David!' LIKE 'David_';
- -> 1
- mysql> SELECT 'David!' LIKE '%D%v%';
- -> 1
- ","string-comparison-functions"),(293,19,"MULTIPOINT","MultiPoint(pt1,pt2,...)
- Constructs a WKB MultiPoint value using WKB Point arguments. If any
- argument is not a WKB Point, the return value is NULL.
- ","","gis-mysql-specific-functions"),(294,18,">>","Syntax:
- >>
- Shifts a longlong (BIGINT) number to the right.
- ","mysql> SELECT 4 >> 2;
- -> 1
- ","bit-functions"),(295,23,"TRUE FALSE","Beginning with MySQL 4.1, the constant TRUE evaluates to 1 and the
- constant FALSE evaluates to 0. The constant names can be written in any
- lettercase.
- mysql> SELECT TRUE, true, FALSE, false;
- -> 1, 1, 0, 0
- ","","boolean-values"),(296,14,"AVG","Syntax:
- Returns the average value of expr.
- AVG() returns NULL if there were no matching rows.
- ","mysql> SELECT student_name, AVG(test_score)
- -> FROM student
- -> GROUP BY student_name;
- ","group-by-functions"),(297,6,"MBRWITHIN","MBRWithin(g1,g2)
- Returns 1 or 0 to indicate whether or not the Minimum Bounding
- Rectangle of g1 is within the Minimum Bounding Rectangle of g2.
- ","mysql> SET @g1 = GeomFromText('Polygon((0 0,0 3,3 3,3 0,0 0))');
- mysql> SET @g2 = GeomFromText('Polygon((0 0,0 5,5 5,5 0,0 0))');
- mysql> SELECT MBRWithin(@g1,@g2), MBRWithin(@g2,@g1);
- +--------------------+--------------------+
- | MBRWithin(@g1,@g2) | MBRWithin(@g2,@g1) |
- +--------------------+--------------------+
- | 1 | 0 |
- +--------------------+--------------------+
- ","relations-on-geometry-mbr"),(298,17,"IN","Syntax:
- expr IN (value,...)
- Returns 1 if expr is equal to any of the values in the IN list, else
- returns 0. If all values are constants, they are evaluated according to
- the type of expr and sorted. The search for the item then is done using
- a binary search. This means IN is very quick if the IN value list
- consists entirely of constants. Otherwise, type conversion takes place
- according to the rules described at the beginning of this section, but
- applied to all the arguments.
- ","mysql> SELECT 2 IN (0,3,5,'wefwf');
- -> 0
- mysql> SELECT 'wefwf' IN (0,3,5,'wefwf');
- -> 1
- ","comparison-operators"),(299,30,"QUOTE","Syntax:
- QUOTE(str)
- Quotes a string to produce a result that can be used as a properly
- escaped data value in an SQL statement. The string is returned
- surrounded by single quotes and with each instance of single quote
- (`''), backslash (`\'), ASCII NUL, and Control-Z preceded by a
- backslash. If the argument is NULL, the return value is the word "NULL"
- without surrounding single quotes. The QUOTE() function was added in
- MySQL 4.0.3.
- ","mysql> SELECT QUOTE('Don\'t!');
- -> 'Don\'t!'
- mysql> SELECT QUOTE(NULL);
- -> NULL
- ","string-functions");
- insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (300,15,"SESSION_USER","Syntax:
- SESSION_USER()
- SESSION_USER() is a synonym for USER().
- ","","information-functions"),(301,25,"QUARTER","Syntax:
- QUARTER(date)
- Returns the quarter of the year for date, in the range 1 to 4.
- ","mysql> SELECT QUARTER('98-04-01');
- -> 2
- ","date-and-time-functions"),(302,30,"POSITION","Syntax:
- POSITION(substr IN str)
- POSITION(substr IN str) is a synonym for LOCATE(substr,str).
- ","","string-functions"),(303,13,"IS_USED_LOCK","Syntax:
- IS_USED_LOCK(str)
- Checks whether the lock named str is in use (that is, locked). If so,
- it returns the connection identifier of the client that holds the lock.
- Otherwise, it returns NULL.
- ","","miscellaneous-functions"),(304,4,"POLYFROMTEXT","PolyFromText(wkt[,srid]) , PolygonFromText(wkt[,srid])
- Constructs a POLYGON value using its WKT representation and SRID.
- ","","gis-wkt-functions"),(305,10,"DES_ENCRYPT","Syntax:
- DES_ENCRYPT(str[,(key_num|key_str)])
- Encrypts the string with the given key using the Triple-DES algorithm.
- On error, this function returns NULL.
- ","key_num des_key_str
- ","encryption-functions"),(306,30,"LENGTH","Syntax:
- LENGTH(str)
- Returns the length of the string str, measured in bytes. A multi-byte
- character counts as multiple bytes. This means that for a string
- containing five two-byte characters, LENGTH() returns 10, whereas
- CHAR_LENGTH() returns 5.
- ","mysql> SELECT LENGTH('text');
- -> 4
- ","string-functions"),(307,25,"STR_TO_DATE","Syntax:
- STR_TO_DATE(str,format)
- This is the reverse of the DATE_FORMAT() function. It takes a string
- str and a format string format. STR_TO_DATE() returns a DATETIME value
- if the format string contains both date and time parts, or a DATE or
- TIME value if the string contains only date or time parts.
- The date, time, or datetime values contained in str should be given in
- the format indicated by format. For the specifiers that can be used in
- format, see the table in the DATE_FORMAT() function description. All
- other characters are just taken verbatim, thus not being interpreted.
- If str contains an illegal date, time, or datetime value, STR_TO_DATE()
- returns NULL.
- ","","date-and-time-functions"),(308,9,"Y","Y(p)
- Returns the Y-coordinate value for the point p as a double-precision
- number.
- ","mysql> SELECT Y(GeomFromText('Point(56.7 53.34)'));
- +--------------------------------------+
- | Y(GeomFromText('Point(56.7 53.34)')) |
- +--------------------------------------+
- | 53.34 |
- +--------------------------------------+
- ","point-property-functions"),(309,21,"CHECKSUM TABLE","Syntax:
- CHECKSUM TABLE tbl_name [, tbl_name] ... [ QUICK | EXTENDED ]
- Reports a table checksum.
- If QUICK is specified, the live table checksum is reported if it is
- available, or NULL otherwise. This is very fast. A live checksum is
- enabled by specifying the CHECKSUM=1 table option, currently supported
- only for MyISAM tables. See [create-table].
- In EXTENDED mode the whole table is read row by row and the checksum is
- calculated. This can be very slow for large tables.
- By default, if neither QUICK nor EXTENDED is specified, MySQL returns a
- live checksum if the table storage engine supports it and scans the
- table otherwise.
- CHECKSUM TABLE returns NULL for non-existent tables.
- ","","checksum-table"),(310,2,"NUMINTERIORRINGS","NumInteriorRings(poly)
- Returns the number of interior rings in the Polygon value poly.
- ","mysql> SET @poly =
- -> 'Polygon((0 0,0 3,3 3,3 0,0 0),(1 1,1 2,2 2,2 1,1 1))';
- mysql> SELECT NumInteriorRings(GeomFromText(@poly));
- +---------------------------------------+
- | NumInteriorRings(GeomFromText(@poly)) |
- +---------------------------------------+
- | 1 |
- +---------------------------------------+
- ","polygon-property-functions"),(311,2,"INTERIORRINGN","InteriorRingN(poly,n)
- Returns the n-th interior ring for the Polygon value poly as a
- LineString. Ring numbers begin at 1.
- ","mysql> SET @poly =
- -> 'Polygon((0 0,0 3,3 3,3 0,0 0),(1 1,1 2,2 2,2 1,1 1))';
- mysql> SELECT AsText(InteriorRingN(GeomFromText(@poly),1));
- +----------------------------------------------+
- | AsText(InteriorRingN(GeomFromText(@poly),1)) |
- +----------------------------------------------+
- | LINESTRING(1 1,1 2,2 2,2 1,1 1) |
- +----------------------------------------------+
- ","polygon-property-functions"),(312,25,"UTC_TIME","Syntax:
- UTC_TIME, UTC_TIME()
- Returns the current UTC time as a value in 'HH:MM:SS' or HHMMSS format,
- depending on whether the function is used in a string or numeric
- context.
- ","mysql> SELECT UTC_TIME(), UTC_TIME() + 0;
- -> '18:07:53', 180753
- ","date-and-time-functions"),(313,14,"STDDEV","Syntax:
- STD(expr) STDDEV(expr)
- Returns the population standard deviation of expr. This is an extension
- to standard SQL. The STDDEV() form of this function is provided for
- compatibility with Oracle.
- These functions return NULL if there were no matching rows.
- ","","group-by-functions"),(314,25,"PERIOD_ADD","Syntax:
- PERIOD_ADD(P,N)
- Adds N months to period P (in the format YYMM or YYYYMM). Returns a
- value in the format YYYYMM. Note that the period argument P is not a
- date value.
- ","mysql> SELECT PERIOD_ADD(9801,2);
- -> 199803
- ","date-and-time-functions");
- insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (315,18,"|","Syntax:
- |
- Bitwise OR:
- ","mysql> SELECT 29 | 15;
- -> 31
- ","bit-functions"),(316,4,"GEOMFROMTEXT","GeomFromText(wkt[,srid]) , GeometryFromText(wkt[,srid])
- Constructs a geometry value of any type using its WKT representation
- and SRID.
- ","","gis-wkt-functions"),(317,30,"RIGHT","Syntax:
- RIGHT(str,len)
- Returns the rightmost len characters from the string str.
- ","mysql> SELECT RIGHT('foobarbar', 4);
- -> 'rbar'
- ","string-functions"),(318,25,"DATEDIFF","Syntax:
- DATEDIFF(expr,expr2)
- DATEDIFF() returns the number of days between the start date expr and
- the end date expr2. expr and expr2 are date or date-and-time
- expressions. Only the date parts of the values are used in the
- calculation.
- ","mysql> SELECT DATEDIFF('1997-12-31 23:59:59','1997-12-30');
- -> 1
- mysql> SELECT DATEDIFF('1997-11-30 23:59:59','1997-12-31');
- -> -31
- ","date-and-time-functions"),(319,21,"CHECK TABLE","Syntax:
- CHECK TABLE tbl_name [, tbl_name] ... [option] ...
- option = {QUICK | FAST | MEDIUM | EXTENDED | CHANGED}
- Checks a table or tables for errors. CHECK TABLE works for MyISAM and
- InnoDB tables. For MyISAM tables, the key statistics are updated.
- ","","check-table"),(320,30,"BIN","Syntax:
- BIN(N)
- Returns a string representation of the binary value of N, where N is a
- longlong (BIGINT) number. This is equivalent to CONV(N,10,2). Returns
- NULL if N is NULL.
- ","mysql> SELECT BIN(12);
- -> '1100'
- ","string-functions"),(321,19,"MULTILINESTRING","MultiLineString(ls1,ls2,...)
- Constructs a WKB MultiLineString value using WKB LineString arguments.
- If any argument is not a WKB LineString, the return value is NULL.
- ","","gis-mysql-specific-functions"),(322,22,"LOAD DATA","Syntax:
- LOAD DATA [LOW_PRIORITY | CONCURRENT] [LOCAL] INFILE 'file_name.txt'
- [REPLACE | IGNORE]
- INTO TABLE tbl_name
- [FIELDS
- [TERMINATED BY 'string']
- [[OPTIONALLY] ENCLOSED BY 'char']
- [ESCAPED BY 'char' ]
- ]
- [LINES
- [STARTING BY 'string']
- [TERMINATED BY 'string']
- ]
- [IGNORE number LINES]
- [(col_name,...)]
- The LOAD DATA INFILE statement reads rows from a text file into a table
- at a very high speed. The filename must be given as a literal string.
- For more information about the efficiency of INSERT versus LOAD DATA
- INFILE and speeding up LOAD DATA INFILE, see [insert-speed].
- As of MySQL 4.1, the character set indicated by the
- character_set_database system variable is used to interpret the
- information in the file. SET NAMES and the setting of
- character_set_client do not affect interpretation of input.
- Note that it's currently not possible to load UCS2 data files.
- You can also load data files by using the mysqlimport utility; it
- operates by sending a LOAD DATA INFILE statement to the server. The
- --local option causes mysqlimport to read data files from the client
- host. You can specify the --compress option to get better performance
- over slow networks if the client and server support the compressed
- protocol. See [mysqlimport].
- If you use LOW_PRIORITY, execution of the LOAD DATA statement is
- delayed until no other clients are reading from the table.
- If you specify CONCURRENT with a MyISAM table that satisfies the
- condition for concurrent inserts (that is, it contains no free blocks
- in the middle), then other threads can retrieve data from the table
- while LOAD DATA is executing. Using this option affects the performance
- of LOAD DATA a bit, even if no other thread is using the table at the
- same time.
- If LOCAL is specified, it is interpreted with respect to the client end
- of the connection:
- o If LOCAL is specified, the file is read by the client program on the
- client host and sent to the server. The file can be given as a full
- pathname to specify its exact location. If given as a relative
- pathname, the name is interpreted relative to the directory in which
- the client program was started.
- o If LOCAL is not specified, the file must be located on the server
- host and is read directly by the server.
- LOCAL is available in MySQL 3.22.6 or later.
- When locating files on the server host, the server uses the following
- rules:
- o If an absolute pathname is given, the server uses the pathname as is.
- o If a relative pathname with one or more leading components is given,
- the server searches for the file relative to the server's data
- directory.
- o If a filename with no leading components is given, the server looks
- for the file in the database directory of the default database.
- Note that these rules mean that a file named as ./myfile.txt is read
- from the server's data directory, whereas the same file named as
- myfile.txt is read from the database directory of the default database.
- For example, the following LOAD DATA statement reads the file data.txt
- from the database directory for db1 because db1 is the current
- database, even though the statement explicitly loads the file into a
- table in the db2 database:
- mysql> USE db1;
- mysql> LOAD DATA INFILE 'data.txt' INTO TABLE db2.my_table;
- Note that Windows pathnames are specified using forward slashes rather
- than backslashes. If you do use backslashes, you must double them.
- For security reasons, when reading text files located on the server,
- the files must either reside in the database directory or be readable
- by all. Also, to use LOAD DATA INFILE on server files, you must have
- the FILE privilege.
- ","","load-data"),(323,25,"LOCALTIME","Syntax:
- LOCALTIME, LOCALTIME()
- LOCALTIME and LOCALTIME() are synonyms for NOW().
- ","","date-and-time-functions"),(324,4,"MPOINTFROMTEXT","MPointFromText(wkt[,srid]) , MultiPointFromText(wkt[,srid])
- Constructs a MULTIPOINT value using its WKT representation and SRID.
- ","","gis-wkt-functions"),(325,3,"BLOB","BLOB[(M)]
- A BLOB column with a maximum length of 65,535 (216 - 1) bytes.
- Beginning with MySQL 4.1, an optional length M can be given. MySQL will
- create the column as the smallest BLOB type largest enough to hold
- values M bytes long.
- ","","string-type-overview"),(326,10,"PASSWORD","Syntax:
- PASSWORD(str)
- Calculates and returns a password string from the plaintext password
- str, or NULL if the argument was NULL. This is the function that is
- used for encrypting MySQL passwords for storage in the Password column
- of the user grant table.
- ","mysql> SELECT PASSWORD('badpwd');
- -> '7f84554057dd964b'
- ","encryption-functions"),(327,3,"CHAR","[NATIONAL] CHAR(M) [BINARY | ASCII | UNICODE]
- A fixed-length string that is always right-padded with spaces to the
- specified length when stored. M represents the column length. The range
- of M is 0 to 255 characters (1 to 255 prior to MySQL 3.23).
- Note: Trailing spaces are removed when CHAR values are retrieved.
- In MySQL 4.1, a CHAR column with a length specification greater than
- 255 is converted to the smallest TEXT type that can hold values of the
- given length. For example, CHAR(500) is converted to TEXT, and
- CHAR(200000) is converted to MEDIUMTEXT. This is a compatibility
- feature. However, this conversion causes the column to become a
- variable-length column, and also affects trailing-space removal.
- ","","string-type-overview"),(328,25,"UTC_DATE","Syntax:
- UTC_DATE, UTC_DATE()
- Returns the current UTC date as a value in 'YYYY-MM-DD' or YYYYMMDD
- format, depending on whether the function is used in a string or
- numeric context.
- ","mysql> SELECT UTC_DATE(), UTC_DATE() + 0;
- -> '2003-08-14', 20030814
- ","date-and-time-functions"),(329,29,"DIMENSION","Dimension(g)
- Returns the inherent dimension of the geometry value g. The result can
- be −1, 0, 1, or 2. (The meaning of these values is given in
- [gis-class-geometry].)
- ","mysql> SELECT Dimension(GeomFromText('LineString(1 1,2 2)'));
- +------------------------------------------------+
- | Dimension(GeomFromText('LineString(1 1,2 2)')) |
- +------------------------------------------------+
- | 1 |
- +------------------------------------------------+
- ","general-geometry-property-functions");
- insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (330,14,"COUNT DISTINCT","Syntax:
- COUNT(DISTINCT expr,[expr...])
- Returns a count of the number of different non-NULL values.
- COUNT(DISTINCT) returns 0 if there were no matching rows.
- ","mysql> SELECT COUNT(DISTINCT results) FROM student;
- ","group-by-functions"),(331,3,"BIT","BIT
- In versions of MySQL up to and lincluding 4.1, BIT is a synonym for
- TINYINT(1).
- ","","numeric-type-overview"),(332,24,"EQUALS","Equals(g1,g2)
- Returns 1 or 0 to indicate whether or not g1 is spatially equal to g2.
- ","","functions-that-test-spatial-relationships-between-geometries"),(333,17,"INTERVAL","Syntax:
- INTERVAL(N,N1,N2,N3,...)
- Returns 0 if N < N1, 1 if N < N2 and so on or -1 if N is NULL. All
- arguments are treated as integers. It is required that N1 < N2 < N3 <
- ... < Nn for this function to work correctly. This is because a binary
- search is used (very fast).
- ","mysql> SELECT INTERVAL(23, 1, 15, 17, 30, 44, 200);
- -> 3
- mysql> SELECT INTERVAL(10, 1, 10, 100, 1000);
- -> 2
- mysql> SELECT INTERVAL(22, 23, 30, 44, 200);
- -> 0
- ","comparison-operators"),(334,25,"FROM_DAYS","Syntax:
- FROM_DAYS(N)
- Given a daynumber N, returns a DATE value.
- ","mysql> SELECT FROM_DAYS(729669);
- -> '1997-10-07'
- ","date-and-time-functions"),(335,18,"BIT_COUNT","Syntax:
- BIT_COUNT(N)
- Returns the number of bits that are set in the argument N.
- ","mysql> SELECT BIT_COUNT(29);
- -> 4
- ","bit-functions"),(336,25,"UTC_TIMESTAMP","Syntax:
- UTC_TIMESTAMP, UTC_TIMESTAMP()
- Returns the current UTC date and time as a value in 'YYYY-MM-DD
- HH:MM:SS' or YYYYMMDDHHMMSS format, depending on whether the function
- is used in a string or numeric context.
- ","mysql> SELECT UTC_TIMESTAMP(), UTC_TIMESTAMP() + 0;
- -> '2003-08-14 18:08:04', 20030814180804
- ","date-and-time-functions"),(337,5,"+","Syntax:
- +
- Addition:
- ","mysql> SELECT 3+5;
- -> 8
- ","arithmetic-functions"),(338,13,"INET_NTOA","Syntax:
- INET_NTOA(expr)
- Given a numeric network address (4 or 8 byte), returns the dotted-quad
- representation of the address as a string.
- ","mysql> SELECT INET_NTOA(3520061480);
- -> '209.207.224.40'
- ","miscellaneous-functions"),(339,5,"ACOS","Syntax:
- ACOS(X)
- Returns the arc cosine of X, that is, the value whose cosine is X.
- Returns NULL if X is not in the range -1 to 1.
- ","mysql> SELECT ACOS(1);
- -> 0.000000
- mysql> SELECT ACOS(1.0001);
- -> NULL
- mysql> SELECT ACOS(0);
- -> 1.570796
- ","mathematical-functions"),(340,8,"ISOLATION","Syntax:
- SET [GLOBAL | SESSION] TRANSACTION ISOLATION LEVEL
- { READ UNCOMMITTED | READ COMMITTED | REPEATABLE READ | SERIALIZABLE }
- This statement sets the transaction isolation level for the next
- transaction, globally, or for the current session.
- The default behavior of SET TRANSACTION is to set the isolation level
- for the next (not yet started) transaction. If you use the GLOBAL
- keyword, the statement sets the default transaction level globally for
- all new connections created from that point on. Existing connections
- are unaffected. You need the SUPER privilege to do this. Using the
- SESSION keyword sets the default transaction level for all future
- transactions performed on the current connection.
- For descriptions of each InnoDB transaction isolation level, see
- [innodb-transaction-isolation]. InnoDB supports each of these levels
- from MySQL 4.0.5 on. The default level is REPEATABLE READ.
- You can set the initial default global isolation level for mysqld with
- the --transaction-isolation option. See [server-options].
- ","","set-transaction"),(341,5,"CEILING","Syntax:
- CEILING(X) CEIL(X)
- Returns the smallest integer value not less than X.
- ","mysql> SELECT CEILING(1.23);
- -> 2
- mysql> SELECT CEIL(-1.23);
- -> -1
- ","mathematical-functions"),(342,5,"SIN","Syntax:
- SIN(X)
- Returns the sine of X, where X is given in radians.
- ","mysql> SELECT SIN(PI());
- -> 1.2246063538224e-16
- mysql> SELECT ROUND(SIN(PI()));
- -> 0
- ","mathematical-functions"),(343,25,"DAYOFWEEK","Syntax:
- DAYOFWEEK(date)
- Returns the weekday index for date (1 = Sunday, 2 = Monday, ..., 7 =
- Saturday). These index values correspond to the ODBC standard.
- ","mysql> SELECT DAYOFWEEK('1998-02-03');
- -> 3
- ","date-and-time-functions"),(344,26,"LINEFROMWKB","LineFromWKB(wkb[,srid]) , LineStringFromWKB(wkb[,srid])
- Constructs a LINESTRING value using its WKB representation and SRID.
- ","","gis-wkb-functions");
- insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (345,22,"SHOW PROCESSLIST","Syntax:
- SHOW [FULL] PROCESSLIST
- SHOW PROCESSLIST shows you which threads are running. You can also get
- this information using the mysqladmin processlist statement. If you
- have the SUPER privilege, you can see all threads. Otherwise, you can
- see only your own threads (that is, threads associated with the MySQL
- account that you are using). See [kill]. If you do not use the FULL
- keyword, only the first 100 characters of each query are shown.
- ","","show-processlist"),(346,29,"GEOMETRYTYPE","GeometryType(g)
- Returns as a string the name of the geometry type of which the geometry
- instance g is a member. The name corresponds to one of the instantiable
- Geometry subclasses.
- ","mysql> SELECT GeometryType(GeomFromText('POINT(1 1)'));
- +------------------------------------------+
- | GeometryType(GeomFromText('POINT(1 1)')) |
- +------------------------------------------+
- | POINT |
- +------------------------------------------+
- ","general-geometry-property-functions"),(347,30,"TRIM","Syntax:
- TRIM([{BOTH | LEADING | TRAILING} [remstr] FROM] str) TRIM(remstr FROM]
- str)
- Returns the string str with all remstr prefixes and/or suffixes
- removed. If none of the specifiers BOTH, LEADING, or TRAILING is given,
- BOTH is assumed. remstr is optional and, if not specified, spaces are
- removed.
- ","mysql> SELECT TRIM(' bar ');
- -> 'bar'
- mysql> SELECT TRIM(LEADING 'x' FROM 'xxxbarxxx');
- -> 'barxxx'
- mysql> SELECT TRIM(BOTH 'x' FROM 'xxxbarxxx');
- -> 'bar'
- mysql> SELECT TRIM(TRAILING 'xyz' FROM 'barxxyz');
- -> 'barx'
- ","string-functions"),(348,25,"GET_FORMAT","Syntax:
- GET_FORMAT(DATE|TIME|DATETIME, 'EUR'|'USA'|'JIS'|'ISO'|'INTERNAL')
- Returns a format string. This function is useful in combination with
- the DATE_FORMAT() and the STR_TO_DATE() functions.
- ","mysql> SELECT DATE_FORMAT('2003-10-03',GET_FORMAT(DATE,'EUR'));
- -> '03.10.2003'
- mysql> SELECT STR_TO_DATE('10.31.2003',GET_FORMAT(DATE,'USA'));
- -> '2003-10-31'
- Following is commented out because not yet implemented:
- ","date-and-time-functions"),(349,3,"TINYBLOB","TINYBLOB
- A BLOB column with a maximum length of 255 (28 - 1) bytes.
- ","","string-type-overview"),(350,8,"SAVEPOINT","Syntax:
- SAVEPOINT identifier
- ROLLBACK TO SAVEPOINT identifier
- Starting from MySQL 4.0.14 and 4.1.1, InnoDB supports the SQL
- statements SAVEPOINT and ROLLBACK TO SAVEPOINT.
- ","","savepoints"),(351,7,"IF","Syntax:
- IF(expr1,expr2,expr3)
- If expr1 is TRUE (expr1 <> 0 and expr1 <> NULL) then IF() returns
- expr2; otherwise it returns expr3. IF() returns a numeric or string
- value, depending on the context in which it is used.
- ","mysql> SELECT IF(1>2,2,3);
- -> 3
- mysql> SELECT IF(1<2,'yes','no');
- -> 'yes'
- mysql> SELECT IF(STRCMP('test','test1'),'no','yes');
- -> 'no'
- ","control-flow-functions"),(352,15,"USER","Syntax:
- USER()
- Returns the current MySQL username and hostname.
- ","mysql> SELECT USER();
- -> 'davida@localhost'
- ","information-functions"),(353,26,"MPOINTFROMWKB","MPointFromWKB(wkb[,srid]) , MultiPointFromWKB(wkb[,srid])
- Constructs a MULTIPOINT value using its WKB representation and SRID.
- ","","gis-wkb-functions"),(354,32,"ALTER TABLE","Syntax:
- ALTER [IGNORE] TABLE tbl_name
- alter_specification [, alter_specification] ...
- alter_specification:
- ADD [COLUMN] column_definition [FIRST | AFTER col_name ]
- | ADD [COLUMN] (column_definition,...)
- | ADD INDEX [index_name] [index_type] (index_col_name,...)
- | ADD [CONSTRAINT [symbol]]
- PRIMARY KEY [index_type] (index_col_name,...)
- | ADD [CONSTRAINT [symbol]]
- UNIQUE [index_name] [index_type] (index_col_name,...)
- | ADD [FULLTEXT|SPATIAL] [index_name] (index_col_name,...)
- | ADD [CONSTRAINT [symbol]]
- FOREIGN KEY [index_name] (index_col_name,...)
- [reference_definition]
- | ALTER [COLUMN] col_name {SET DEFAULT literal | DROP DEFAULT}
- | CHANGE [COLUMN] old_col_name column_definition
- [FIRST|AFTER col_name]
- | MODIFY [COLUMN] column_definition [FIRST | AFTER col_name]
- | DROP [COLUMN] col_name
- | DROP PRIMARY KEY
- | DROP INDEX index_name
- | DROP FOREIGN KEY fk_symbol
- | DISABLE KEYS
- | ENABLE KEYS
- | RENAME [TO] new_tbl_name
- | ORDER BY col_name
- | CONVERT TO CHARACTER SET charset_name [COLLATE collation_name]
- | [DEFAULT] CHARACTER SET charset_name [COLLATE collation_name]
- | DISCARD TABLESPACE
- | IMPORT TABLESPACE
- | table_options
- ALTER TABLE allows you to change the structure of an existing table.
- For example, you can add or delete columns, create or destroy indexes,
- change the type of existing columns, or rename columns or the table
- itself. You can also change the comment for the table and type of the
- table.
- ","","alter-table"),(355,22,"PURGE MASTER LOGS","Syntax:
- PURGE {MASTER | BINARY} LOGS TO 'log_name'
- PURGE {MASTER | BINARY} LOGS BEFORE 'date'
- Deletes all the binary logs listed in the log index prior to the
- specified log or date. The logs also are removed from the list recorded
- in the log index file, so that the given log becomes the first.
- ","PURGE MASTER LOGS TO 'mysql-bin.010';
- PURGE MASTER LOGS BEFORE '2003-04-02 22:46:26';
- ","purge-master-logs"),(356,3,"CHAR BYTE","From MySQL 4.1.0 on, the column type CHAR BYTE is an alias for CHAR
- BINARY. This is a compatibility feature.
- ","","string-type-overview"),(357,21,"REPAIR TABLE","Syntax:
- REPAIR [LOCAL | NO_WRITE_TO_BINLOG] TABLE
- tbl_name [, tbl_name] ... [QUICK] [EXTENDED] [USE_FRM]
- REPAIR TABLE repairs a possibly corrupted table. By default, it has the
- same effect as myisamchk --recover tbl_name. REPAIR TABLE works on
- MyISAM and on ARCHIVE tables. See [myisam-storage-engine],
- [archive-storage-engine].
- ","","repair-table"),(358,16,"MERGE","The MERGE storage engine was introduced in MySQL 3.23.25. It is also
- known as the MRG_MyISAM engine.
- A MERGE table is a collection of identical MyISAM tables that can be
- used as one. "Identical" means that all tables have identical column
- and index information. You cannot merge tables in which the columns are
- listed in a different order, do not have exactly the same columns, or
- have the indexes in different order. However, any or all of the tables
- can be compressed with myisampack. See [myisampack]. Differences in
- table options such as AVG_ROW_LENGTH, MAX_ROWS, or PACK_KEYS do not
- matter.
- ","mysql> CREATE TABLE t1 (
- -> a INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
- -> message CHAR(20));
- mysql> CREATE TABLE t2 (
- -> a INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
- -> message CHAR(20));
- mysql> INSERT INTO t1 (message) VALUES ('Testing'),('table'),('t1');
- mysql> INSERT INTO t2 (message) VALUES ('Testing'),('table'),('t2');
- mysql> CREATE TABLE total (
- -> a INT NOT NULL AUTO_INCREMENT,
- -> message CHAR(20), INDEX(a))
- -> TYPE=MERGE UNION=(t1,t2) INSERT_METHOD=LAST;
- ","merge-storage-engine"),(359,32,"CREATE TABLE","Syntax:
- CREATE [TEMPORARY] TABLE [IF NOT EXISTS] tbl_name
- [(create_definition,...)]
- [table_options] [select_statement]
- Or:
- CREATE [TEMPORARY] TABLE [IF NOT EXISTS] tbl_name
- [(] LIKE old_tbl_name [)];
- create_definition:
- column_definition
- | [CONSTRAINT [symbol]] PRIMARY KEY [index_type] (index_col_name,...)
- | KEY [index_name] [index_type] (index_col_name,...)
- | INDEX [index_name] [index_type] (index_col_name,...)
- | [CONSTRAINT [symbol]] UNIQUE [INDEX]
- [index_name] [index_type] (index_col_name,...)
- | [FULLTEXT|SPATIAL] [INDEX] [index_name] (index_col_name,...)
- | [CONSTRAINT [symbol]] FOREIGN KEY
- [index_name] (index_col_name,...) [reference_definition]
- | CHECK (expr)
- column_definition:
- col_name type [NOT NULL | NULL] [DEFAULT default_value]
- [AUTO_INCREMENT] [UNIQUE [KEY] | [PRIMARY] KEY]
- [COMMENT 'string'] [reference_definition]
- type:
- TINYINT[(length)] [UNSIGNED] [ZEROFILL]
- | SMALLINT[(length)] [UNSIGNED] [ZEROFILL]
- | MEDIUMINT[(length)] [UNSIGNED] [ZEROFILL]
- | INT[(length)] [UNSIGNED] [ZEROFILL]
- | INTEGER[(length)] [UNSIGNED] [ZEROFILL]
- | BIGINT[(length)] [UNSIGNED] [ZEROFILL]
- | REAL[(length,decimals)] [UNSIGNED] [ZEROFILL]
- | DOUBLE[(length,decimals)] [UNSIGNED] [ZEROFILL]
- | FLOAT[(length,decimals)] [UNSIGNED] [ZEROFILL]
- | DECIMAL(length,decimals) [UNSIGNED] [ZEROFILL]
- | NUMERIC(length,decimals) [UNSIGNED] [ZEROFILL]
- | DATE
- | TIME
- | TIMESTAMP
- | DATETIME
- | CHAR(length) [BINARY | ASCII | UNICODE]
- | VARCHAR(length) [BINARY]
- | TINYBLOB
- | BLOB
- | MEDIUMBLOB
- | LONGBLOB
- | TINYTEXT [BINARY]
- | TEXT [BINARY]
- | MEDIUMTEXT [BINARY]
- | LONGTEXT [BINARY]
- | ENUM(value1,value2,value3,...)
- | SET(value1,value2,value3,...)
- | spatial_type
- index_col_name:
- col_name [(length)] [ASC | DESC]
- reference_definition:
- REFERENCES tbl_name [(index_col_name,...)]
- [MATCH FULL | MATCH PARTIAL | MATCH SIMPLE]
- [ON DELETE reference_option]
- [ON UPDATE reference_option]
- reference_option:
- RESTRICT | CASCADE | SET NULL | NO ACTION
- table_options: table_option [table_option] ...
- table_option:
- {ENGINE|TYPE} = engine_name
- | AUTO_INCREMENT = value
- | AVG_ROW_LENGTH = value
- | [DEFAULT] CHARACTER SET charset_name [COLLATE collation_name]
- | CHECKSUM = {0 | 1}
- | COMMENT = 'string'
- | MAX_ROWS = value
- | MIN_ROWS = value
- | PACK_KEYS = {0 | 1 | DEFAULT}
- | PASSWORD = 'string'
- | DELAY_KEY_WRITE = {0 | 1}
- | ROW_FORMAT = {DEFAULT|DYNAMIC|FIXED|COMPRESSED|REDUNDANT|COMPACT}
- | RAID_TYPE = { 1 | STRIPED | RAID0 }
- RAID_CHUNKS = value
- RAID_CHUNKSIZE = value
- | UNION = (tbl_name[,tbl_name]...)
- | INSERT_METHOD = { NO | FIRST | LAST }
- | DATA DIRECTORY = 'absolute path to directory'
- | INDEX DIRECTORY = 'absolute path to directory'
- select_statement:
- [IGNORE | REPLACE] [AS] SELECT ... (Some legal select statement)
- CREATE TABLE creates a table with the given name. You must have the
- CREATE privilege for the table.
- Rules for allowable table names are given in [legal-names]. By default,
- the table is created in the current database. An error occurs if the
- table exists, if there is no current database, or if the database does
- not exist.
- ","","create-table");
- insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (360,17,">","Syntax:
- >
- Greater than:
- ","mysql> SELECT 2 > 2;
- -> 0
- ","comparison-operators"),(361,21,"ANALYZE TABLE","Syntax:
- ANALYZE [LOCAL | NO_WRITE_TO_BINLOG] TABLE tbl_name [, tbl_name] ...
- This statement analyzes and stores the key distribution for a table.
- During the analysis, the table is locked with a read lock. This works
- on MyISAM and BDB tables and (as of MySQL 4.0.13) InnoDB tables. For
- MyISAM tables, this statement is equivalent to using myisamchk -a.
- MySQL uses the stored key distribution to decide the order in which
- tables should be joined when you perform a join on something other than
- a constant.
- ","","analyze-table"),(362,25,"MICROSECOND","Syntax:
- MICROSECOND(expr)
- Returns the microseconds from the time or datetime expression expr as a
- number in the range from 0 to 999999.
- ","mysql> SELECT MICROSECOND('12:00:00.123456');
- -> 123456
- mysql> SELECT MICROSECOND('1997-12-31 23:59:59.000010');
- -> 10
- ","date-and-time-functions"),(363,32,"CONSTRAINT","The syntax of a foreign key constraint definition in InnoDB looks like
- this:
- [CONSTRAINT symbol] FOREIGN KEY [id] (index_col_name, ...)
- REFERENCES tbl_name (index_col_name, ...)
- [ON DELETE {RESTRICT | CASCADE | SET NULL | NO ACTION}]
- [ON UPDATE {RESTRICT | CASCADE | SET NULL | NO ACTION}]
- ","CREATE TABLE product (category INT NOT NULL, id INT NOT NULL,
- price DECIMAL,
- PRIMARY KEY(category, id)) TYPE=INNODB;
- CREATE TABLE customer (id INT NOT NULL,
- PRIMARY KEY (id)) TYPE=INNODB;
- CREATE TABLE product_order (no INT NOT NULL AUTO_INCREMENT,
- product_category INT NOT NULL,
- product_id INT NOT NULL,
- customer_id INT NOT NULL,
- PRIMARY KEY(no),
- INDEX (product_category, product_id),
- FOREIGN KEY (product_category, product_id)
- REFERENCES product(category, id)
- ON UPDATE CASCADE ON DELETE RESTRICT,
- INDEX (customer_id),
- FOREIGN KEY (customer_id)
- REFERENCES customer(id)) TYPE=INNODB;
- ","innodb-foreign-key-constraints"),(364,30,"FIELD","Syntax:
- FIELD(str,str1,str2,str3,...)
- Returns the index of str in the str1, str2, str3, ... list. Returns 0
- if str is not found.
- If all arguments to FIELD() are strings, all arguments are compared as
- strings. If all arguments are numbers, they are compared as numbers.
- Otherwise, the arguments are compared as double.
- If str is NULL, the return value is 0 because NULL fails equality
- comparison with any value. FIELD() is the complement of ELT().
- ","mysql> SELECT FIELD('ej', 'Hej', 'ej', 'Heja', 'hej', 'foo');
- -> 2
- mysql> SELECT FIELD('fo', 'Hej', 'ej', 'Heja', 'hej', 'foo');
- -> 0
- ","string-functions"),(365,25,"MAKETIME","Syntax:
- MAKETIME(hour,minute,second)
- Returns a time value calculated from the hour, minute, and second
- arguments.
- ","mysql> SELECT MAKETIME(12,15,30);
- -> '12:15:30'
- ","date-and-time-functions"),(366,25,"CURDATE","Syntax:
- CURDATE()
- Returns the current date as a value in 'YYYY-MM-DD' or YYYYMMDD format,
- depending on whether the function is used in a string or numeric
- context.
- ","mysql> SELECT CURDATE();
- -> '1997-12-15'
- mysql> SELECT CURDATE() + 0;
- -> 19971215
- ","date-and-time-functions"),(367,14,"MIN MAX","Syntax:
- MIN(expr), MAX(expr)
- Returns the minimum or maximum value of expr. MIN() and MAX() may take
- a string argument; in such cases they return the minimum or maximum
- string value. See [mysql-indexes].
- MIN() and MAX() return NULL if there were no matching rows.
- ","mysql> SELECT student_name, MIN(test_score), MAX(test_score)
- -> FROM student
- -> GROUP BY student_name;
- ","group-by-functions"),(368,21,"SET PASSWORD","Syntax:
- SET PASSWORD = PASSWORD('some password')
- SET PASSWORD FOR user = PASSWORD('some password')
- The SET PASSWORD statement assigns a password to an existing MySQL user
- account.
- The first syntax sets the password for the current user. Any client
- that has connected to the server using a non-anonymous account can
- change the password for that account.
- The second syntax sets the password for a specific account on the
- current server host. Only clients with the UPDATE privilege for the
- mysql database can do this. The user value should be given in
- user_name@host_name format, where user_name and host_name are exactly
- as they are listed in the User and Host columns of the mysql.user table
- entry. For example, if you had an entry with User and Host column
- values of 'bob' and '%.loc.gov', you would write the statement like
- this:
- mysql> SET PASSWORD FOR 'bob'@'%.loc.gov' = PASSWORD('newpass');
- ","","set-password"),(369,3,"ENUM","ENUM('value1','value2',...)
- An enumeration. A string object that can have only one value, chosen
- from the list of values 'value1', 'value2', ..., NULL or the special ''
- error value. An ENUM column can have a maximum of 65,535 distinct
- values. ENUM values are represented internally as integers.
- ","","string-type-overview"),(370,15,"DATABASE","Syntax:
- DATABASE()
- Returns the default (current) database name. As of MySQL 4.1, the
- string uses the utf8 character set.
- ","mysql> SELECT DATABASE();
- -> 'test'
- ","information-functions"),(371,26,"POINTFROMWKB","PointFromWKB(wkb[,srid])
- Constructs a POINT value using its WKB representation and SRID.
- ","","gis-wkb-functions"),(372,5,"POWER","Syntax:
- POW(X,Y) , POWER(X,Y)
- Returns the value of X raised to the power of Y.
- ","mysql> SELECT POW(2,2);
- -> 4.000000
- mysql> SELECT POW(2,-2);
- -> 0.250000
- ","mathematical-functions"),(373,5,"ATAN","Syntax:
- ATAN(X)
- Returns the arc tangent of X, that is, the value whose tangent is X.
- ","mysql> SELECT ATAN(2);
- -> 1.107149
- mysql> SELECT ATAN(-2);
- -> -1.107149
- ","mathematical-functions"),(374,30,"STRCMP","Syntax:
- STRCMP(expr1,expr2)
- STRCMP() returns 0 if the strings are the same, -1 if the first
- argument is smaller than the second according to the current sort
- order, and 1 otherwise.
- ","mysql> SELECT STRCMP('text', 'text2');
- -> -1
- mysql> SELECT STRCMP('text2', 'text');
- -> 1
- mysql> SELECT STRCMP('text', 'text');
- -> 0
- ","string-comparison-functions");
- insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (375,22,"INSERT DELAYED","Syntax:
- INSERT DELAYED ...
- The DELAYED option for the INSERT statement is a MySQL extension to
- standard SQL that is very useful if you have clients that cannot wait
- for the INSERT to complete. This is a common problem when you use MySQL
- for logging and you also periodically run SELECT and UPDATE statements
- that take a long time to complete. DELAYED was introduced in MySQL
- 3.22.15.
- When a client uses INSERT DELAYED, it gets an okay from the server at
- once, and the row is queued to be inserted when the table is not in use
- by any other thread.
- Another major benefit of using INSERT DELAYED is that inserts from many
- clients are bundled together and written in one block. This is much
- faster than performing many separate inserts.
- There are some constraints on the use of DELAYED:
- o INSERT DELAYED works only with ISAM, MyISAM, and (beginning with
- MySQL 4.1) MEMORY. For MyISAM tables, if there are no free blocks in
- the middle of the data file, concurrent SELECT and INSERT statements
- are supported. Under these circumstances, you very seldom need to use
- INSERT DELAYED with MyISAM. See [myisam-storage-engine],
- [memory-storage-engine], and [archive-storage-engine].
- o INSERT DELAYED should be used only for INSERT statements that specify
- value lists. This is enforced as of MySQL 4.0.18. The server ignores
- DELAYED for INSERT DELAYED ... SELECT statements.
- o The server ignores DELAYED for INSERT DELAYED ... ON DUPLICATE UPDATE
- statements.
- o Because the statement returns immediately before the rows are
- inserted, you cannot use LAST_INSERT_ID() to get the AUTO_INCREMENT
- value which the statement might generate.
- o DELAYED rows are not visible to SELECT statements until they actually
- have been inserted.
- o DELAYED is ignored on slave replication servers because it could
- cause the slave to have different data than the master.
- ","","insert-delayed"),(376,3,"MEDIUMTEXT","MEDIUMTEXT
- A TEXT column with a maximum length of 16,777,215 (224 - 1) characters.
- ","","string-type-overview"),(377,5,"LN","Syntax:
- LN(X)
- Returns the natural logarithm of X, that is, the logarithm of X to the
- base e.
- ","mysql> SELECT LN(2);
- -> 0.693147
- mysql> SELECT LN(-2);
- -> NULL
- ","mathematical-functions"),(378,5,"LOG","Syntax:
- LOG(X) LOG(B,X)
- If called with one parameter, this function returns the natural
- logarithm of X.
- ","mysql> SELECT LOG(2);
- -> 0.693147
- mysql> SELECT LOG(-2);
- -> NULL
- ","mathematical-functions"),(379,22,"SET SQL_LOG_BIN","Syntax:
- SET SQL_LOG_BIN = {0|1}
- Disables or enables binary logging for the current connection
- (SQL_LOG_BIN is a session variable) if the client connects using an
- account that has the SUPER privilege. The statement is refused with an
- error if the client does not have that privilege. (Before MySQL 4.1.2,
- the statement was simply ignored in that case.)
- ","","set-sql-log-bin"),(380,17,"!=","Syntax:
- <>, !=
- Not equal:
- ","mysql> SELECT '.01' <> '0.01';
- -> 1
- mysql> SELECT .01 <> '0.01';
- -> 0
- mysql> SELECT 'zapp' <> 'zappp';
- -> 1
- ","comparison-operators"),(381,10,"AES_DECRYPT","Syntax:
- AES_ENCRYPT(str,key_str) , AES_DECRYPT(crypt_str,key_str)
- These functions allow encryption and decryption of data using the
- official AES (Advanced Encryption Standard) algorithm, previously known
- as "Rijndael". Encoding with a 128-bit key length is used, but you can
- extend it up to 256 bits by modifying the source. We chose 128 bits
- because it is much faster and it is secure enough for most purposes.
- The input arguments may be any length. If either argument is NULL, the
- result of this function is also NULL.
- Because AES is a block-level algorithm, padding is used to encode
- uneven length strings and so the result string length may be calculated
- as 16 * (trunc(string_length / 16) + 1).
- If AES_DECRYPT() detects invalid data or incorrect padding, it returns
- NULL. However, it is possible for AES_DECRYPT() to return a non-NULL
- value (possibly garbage) if the input data or the key is invalid.
- You can use the AES functions to store data in an encrypted form by
- modifying your queries:
- ","INSERT INTO t VALUES (1,AES_ENCRYPT('text','password'));
- ","encryption-functions"),(382,25,"DAYNAME","Syntax:
- DAYNAME(date)
- Returns the name of the weekday for date.
- ","mysql> SELECT DAYNAME('1998-02-05');
- -> 'Thursday'
- ","date-and-time-functions"),(383,15,"COERCIBILITY","Syntax:
- COERCIBILITY(str)
- Returns the collation coercibility value of the string argument.
- ","mysql> SELECT COERCIBILITY('abc' COLLATE latin1_swedish_ci);
- -> 0
- mysql> SELECT COERCIBILITY(USER());
- -> 3
- mysql> SELECT COERCIBILITY('abc');
- -> 4
- ","information-functions"),(384,3,"INT","INT[(M)] [UNSIGNED] [ZEROFILL]
- A normal-size integer. The signed range is -2147483648 to 2147483647.
- The unsigned range is 0 to 4294967295.
- ","","numeric-type-overview"),(385,11,"GLENGTH","GLength(ls)
- Returns as a double-precision number the length of the LineString value
- ls in its associated spatial reference.
- ","mysql> SET @ls = 'LineString(1 1,2 2,3 3)';
- mysql> SELECT GLength(GeomFromText(@ls));
- +----------------------------+
- | GLength(GeomFromText(@ls)) |
- +----------------------------+
- | 2.8284271247462 |
- +----------------------------+
- ","linestring-property-functions"),(386,5,"RADIANS","Syntax:
- RADIANS(X)
- Returns the argument X, converted from degrees to radians. (Note that
- ϖ radians equals 180 degrees.)
- ","mysql> SELECT RADIANS(90);
- -> 1.570796
- ","mathematical-functions"),(387,15,"COLLATION","Syntax:
- COLLATION(str)
- Returns the collation for the character set of the string argument.
- ","mysql> SELECT COLLATION('abc');
- -> 'latin1_swedish_ci'
- mysql> SELECT COLLATION(_utf8'abc');
- -> 'utf8_general_ci'
- ","information-functions"),(388,17,"COALESCE","Syntax:
- COALESCE(value,...)
- Returns the first non-NULL value in the list, or NULL if there are no
- non-NULL values.
- ","mysql> SELECT COALESCE(NULL,1);
- -> 1
- mysql> SELECT COALESCE(NULL,NULL,NULL);
- -> NULL
- ","comparison-operators"),(389,15,"VERSION","Syntax:
- VERSION()
- Returns a string that indicates the MySQL server version. As of MySQL
- 4.1, the string has the utf8 character set.
- ","mysql> SELECT VERSION();
- -> '4.1.15-standard'
- ","information-functions");
- insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (390,30,"MAKE_SET","Syntax:
- MAKE_SET(bits,str1,str2,...)
- Returns a set value (a string containing substrings separated by `,'
- characters) consisting of the strings that have the corresponding bit
- in bits set. str1 corresponds to bit 0, str2 to bit 1, and so on. NULL
- values in str1, str2, ... are not appended to the result.
- ","mysql> SELECT MAKE_SET(1,'a','b','c');
- -> 'a'
- mysql> SELECT MAKE_SET(1 | 4,'hello','nice','world');
- -> 'hello,world'
- mysql> SELECT MAKE_SET(1 | 4,'hello','nice',NULL,'world');
- -> 'hello'
- mysql> SELECT MAKE_SET(0,'a','b','c');
- -> ''
- ","string-functions"),(391,30,"FIND_IN_SET","Syntax:
- FIND_IN_SET(str,strlist)
- Returns a value in the range of 1 to N if the string str is in the
- string list strlist consisting of N substrings. A string list is a
- string composed of substrings separated by `,' characters. If the first
- argument is a constant string and the second is a column of type SET,
- the FIND_IN_SET() function is optimized to use bit arithmetic. Returns
- 0 if str is not in strlist or if strlist is the empty string. Returns
- NULL if either argument is NULL. This function does not work properly
- if the first argument contains a comma (`,') character.
- ","mysql> SELECT FIND_IN_SET('b','a,b,c,d');
- -> 2
- ","string-functions");
- insert into help_keyword (help_keyword_id,name) values (0,"MIN"),(1,"JOIN"),(2,"SERIALIZABLE"),(3,"REPLACE"),(4,"RETURNS"),(5,"MASTER_SSL_CA"),(6,"NCHAR"),(7,"COLUMNS"),(8,"WORK"),(9,"DATETIME"),(10,"MODE"),(11,"OPEN"),(12,"INTEGER"),(13,"ESCAPE"),(14,"VALUE");
- insert into help_keyword (help_keyword_id,name) values (15,"GEOMETRYCOLLECTIONFROMWKB"),(16,"SQL_BIG_RESULT"),(17,"DROP"),(18,"EVENTS"),(19,"MONTH"),(20,"DUPLICATE"),(21,"REPLICATION"),(22,"INNODB"),(23,"YEAR_MONTH"),(24,"SUBJECT"),(25,"LOCK"),(26,"NDB"),(27,"CHECK"),(28,"FULL"),(29,"INT4");
- insert into help_keyword (help_keyword_id,name) values (30,"BY"),(31,"NO"),(32,"MINUTE"),(33,"DATA"),(34,"DAY"),(35,"SHARE"),(36,"RAID_CHUNKSIZE"),(37,"REAL"),(38,"SEPARATOR"),(39,"DELETE"),(40,"ON"),(41,"CLOSE"),(42,"X509"),(43,"USE"),(44,"WHERE");
- insert into help_keyword (help_keyword_id,name) values (45,"PRIVILEGES"),(46,"SPATIAL"),(47,"SUPER"),(48,"SQL_BUFFER_RESULT"),(49,"IGNORE"),(50,"QUICK"),(51,"SIGNED"),(52,"SECURITY"),(53,"POLYGONFROMWKB"),(54,"NDBCLUSTER"),(55,"FALSE"),(56,"LEVEL"),(57,"FORCE"),(58,"BINARY"),(59,"TO");
- insert into help_keyword (help_keyword_id,name) values (60,"CHANGE"),(61,"HOUR_MINUTE"),(62,"UPDATE"),(63,"INTO"),(64,"VARYING"),(65,"HOUR_SECOND"),(66,"VARIABLE"),(67,"ROLLBACK"),(68,"MAX"),(69,"PROCEDURE"),(70,"RTREE"),(71,"TIMESTAMP"),(72,"IMPORT"),(73,"AGAINST"),(74,"CHECKSUM");
- insert into help_keyword (help_keyword_id,name) values (75,"INSERT"),(76,"COUNT"),(77,"LONGBINARY"),(78,"THEN"),(79,"ENGINES"),(80,"DAY_SECOND"),(81,"EXISTS"),(82,"BOOLEAN"),(83,"MOD"),(84,"DEFAULT"),(85,"TYPE"),(86,"NO_WRITE_TO_BINLOG"),(87,"RESET"),(88,"BIGINT"),(89,"SET");
- insert into help_keyword (help_keyword_id,name) values (90,"ISSUER"),(91,"DATE"),(92,"STATUS"),(93,"FULLTEXT"),(94,"COMMENT"),(95,"MASTER_CONNECT_RETRY"),(96,"INNER"),(97,"STOP"),(98,"MASTER_LOG_FILE"),(99,"MRG_MYISAM"),(100,"PRECISION"),(101,"REQUIRE"),(102,"TRAILING"),(103,"LONG"),(104,"OPTION");
- insert into help_keyword (help_keyword_id,name) values (105,"ELSE"),(106,"IO_THREAD"),(107,"CIPHER"),(108,"FROM"),(109,"READ"),(110,"LEFT"),(111,"MINUTE_SECOND"),(112,"COMPACT"),(113,"DEC"),(114,"FOR"),(115,"WARNINGS"),(116,"MIN_ROWS"),(117,"STRING"),(118,"FUNCTION"),(119,"ENCLOSED");
- insert into help_keyword (help_keyword_id,name) values (120,"AGGREGATE"),(121,"FIELDS"),(122,"INT3"),(123,"ARCHIVE"),(124,"ADD"),(125,"AVG_ROW_LENGTH"),(126,"FLOAT4"),(127,"STRIPED"),(128,"REPEATABLE"),(129,"INFILE"),(130,"ORDER"),(131,"USING"),(132,"MIDDLEINT"),(133,"GRANT"),(134,"UNSIGNED");
- insert into help_keyword (help_keyword_id,name) values (135,"DECIMAL"),(136,"GEOMETRYFROMTEXT"),(137,"INDEXES"),(138,"FOREIGN"),(139,"CACHE"),(140,"HOSTS"),(141,"COMMIT"),(142,"LEADING"),(143,"LOAD"),(144,"SQL_CACHE"),(145,"CONVERT"),(146,"DYNAMIC"),(147,"POLYGONFROMTEXT"),(148,"BYTE"),(149,"LINESTRINGFROMWKB");
- insert into help_keyword (help_keyword_id,name) values (150,"GLOBAL"),(151,"BERKELEYDB"),(152,"WHEN"),(153,"HAVING"),(154,"AS"),(155,"STARTING"),(156,"RELOAD"),(157,"AUTOCOMMIT"),(158,"REVOKE"),(159,"GRANTS"),(160,"OUTER"),(161,"FLOOR"),(162,"WITH"),(163,"STD"),(164,"AFTER");
- insert into help_keyword (help_keyword_id,name) values (165,"CSV"),(166,"DISABLE"),(167,"OUTFILE"),(168,"LOW_PRIORITY"),(169,"FILE"),(170,"BDB"),(171,"SONAME"),(172,"POW"),(173,"MULTIPOINTFROMWKB"),(174,"INDEX"),(175,"MULTIPOINTFROMTEXT"),(176,"BACKUP"),(177,"MULTILINESTRINGFROMWKB"),(178,"EXTENDED"),(179,"CROSS");
- insert into help_keyword (help_keyword_id,name) values (180,"NATIONAL"),(181,"GROUP"),(182,"ZEROFILL"),(183,"CLIENT"),(184,"MASTER_PASSWORD"),(185,"RELAY_LOG_FILE"),(186,"TRUE"),(187,"CHARACTER"),(188,"MASTER_USER"),(189,"ENGINE"),(190,"TABLE"),(191,"INSERT_METHOD"),(192,"CASCADE"),(193,"RELAY_LOG_POS"),(194,"SQL_CALC_FOUND_ROWS");
- insert into help_keyword (help_keyword_id,name) values (195,"MYISAM"),(196,"MODIFY"),(197,"MATCH"),(198,"MASTER_LOG_POS"),(199,"DESC"),(200,"DISTINCTROW"),(201,"TIME"),(202,"NUMERIC"),(203,"EXPANSION"),(204,"GEOMETRYCOLLECTIONFROMTEXT"),(205,"RAID_CHUNKS"),(206,"FLUSH"),(207,"CREATE"),(208,"ISAM"),(209,"MAX_UPDATES_PER_HOUR");
- insert into help_keyword (help_keyword_id,name) values (210,"INT2"),(211,"PROCESSLIST"),(212,"LOGS"),(213,"HEAP"),(214,"SOUNDS"),(215,"BETWEEN"),(216,"MULTILINESTRINGFROMTEXT"),(217,"PACK_KEYS"),(218,"FAST"),(219,"VALUES"),(220,"VARCHARACTER"),(221,"BEFORE"),(222,"SHOW"),(223,"REDUNDANT"),(224,"ALL");
- insert into help_keyword (help_keyword_id,name) values (225,"USER_RESOURCES"),(226,"PARTIAL"),(227,"BINLOG"),(228,"END"),(229,"SECOND"),(230,"AND"),(231,"FLOAT8"),(232,"PREV"),(233,"HOUR"),(234,"SELECT"),(235,"DATABASES"),(236,"OR"),(237,"IDENTIFIED"),(238,"MASTER_SSL_CIPHER"),(239,"SQL_SLAVE_SKIP_COUNTER");
- insert into help_keyword (help_keyword_id,name) values (240,"BOTH"),(241,"BOOL"),(242,"YEAR"),(243,"MASTER_PORT"),(244,"CONCURRENT"),(245,"UNIQUE"),(246,"PROCESS"),(247,"MASTER_SSL"),(248,"DATE_ADD"),(249,"MAX_CONNECTIONS_PER_HOUR"),(250,"LIKE"),(251,"IN"),(252,"COLUMN"),(253,"DUMPFILE"),(254,"USAGE");
- insert into help_keyword (help_keyword_id,name) values (255,"EXECUTE"),(256,"MEMORY"),(257,"CEIL"),(258,"QUERY"),(259,"MASTER_HOST"),(260,"LINES"),(261,"SQL_THREAD"),(262,"MAX_QUERIES_PER_HOUR"),(263,"MULTIPOLYGONFROMWKB"),(264,"MASTER_SSL_CERT"),(265,"DAY_MINUTE"),(266,"TRANSACTION"),(267,"DATE_SUB"),(268,"GEOMETRYFROMWKB"),(269,"RENAME");
- insert into help_keyword (help_keyword_id,name) values (270,"INT1"),(271,"ALTER"),(272,"MAX_ROWS"),(273,"RIGHT"),(274,"STRAIGHT_JOIN"),(275,"NATURAL"),(276,"VARIABLES"),(277,"ESCAPED"),(278,"SHA1"),(279,"PASSWORD"),(280,"RAID_TYPE"),(281,"CHAR"),(282,"OFFSET"),(283,"NEXT"),(284,"SQL_LOG_BIN");
- insert into help_keyword (help_keyword_id,name) values (285,"ERRORS"),(286,"TEMPORARY"),(287,"SQL_SMALL_RESULT"),(288,"COMMITTED"),(289,"DELAY_KEY_WRITE"),(290,"BEGIN"),(291,"MEDIUM"),(292,"INTERVAL"),(293,"SSL"),(294,"DAY_HOUR"),(295,"REFERENCES"),(296,"AES_ENCRYPT"),(297,"ISOLATION"),(298,"INT8"),(299,"RESTRICT");
- insert into help_keyword (help_keyword_id,name) values (300,"LINESTRINGFROMTEXT"),(301,"IS"),(302,"UNCOMMITTED"),(303,"NOT"),(304,"DES_KEY_FILE"),(305,"COMPRESSED"),(306,"START"),(307,"IF"),(308,"SAVEPOINT"),(309,"PRIMARY"),(310,"INNOBASE"),(311,"LAST"),(312,"KEYS"),(313,"LIMIT"),(314,"KEY");
- insert into help_keyword (help_keyword_id,name) values (315,"MERGE"),(316,"SQL_NO_CACHE"),(317,"DELAYED"),(318,"CONSTRAINT"),(319,"SERIAL"),(320,"ACTION"),(321,"WRITE"),(322,"SESSION"),(323,"DATABASE"),(324,"NULL"),(325,"USE_FRM"),(326,"SLAVE"),(327,"TERMINATED"),(328,"ASC"),(329,"ENABLE");
- insert into help_keyword (help_keyword_id,name) values (330,"OPTIONALLY"),(331,"DIRECTORY"),(332,"MAX_USER_CONNECTIONS"),(333,"DISTINCT"),(334,"LOCAL"),(335,"MASTER_SSL_KEY"),(336,"NONE"),(337,"TABLES"),(338,"<>"),(339,"RLIKE"),(340,"SHUTDOWN"),(341,"HIGH_PRIORITY"),(342,"BTREE"),(343,"FIRST"),(344,"TYPES");
- insert into help_keyword (help_keyword_id,name) values (345,"MASTER"),(346,"FIXED"),(347,"RAID0"),(348,"MULTIPOLYGONFROMTEXT"),(349,"ROW_FORMAT");
- insert into help_relation (help_topic_id,help_keyword_id) values (367,0),(271,1),(340,2),(322,3),(123,4),(143,5),(327,6),(263,7),(106,8),(289,9),(58,10),(271,10),(263,11),(73,11),(384,12);
- insert into help_relation (help_topic_id,help_keyword_id) values (123,12),(292,13),(183,14),(75,15),(271,16),(57,17),(123,17),(144,17),(211,17),(354,17),(87,18),(19,19),(115,20),(152,21),(263,22);
- insert into help_relation (help_topic_id,help_keyword_id) values (359,22),(19,23),(152,24),(271,25),(359,26),(359,27),(263,28),(359,28),(384,29),(32,30),(359,30),(56,30),(152,30),(271,30),(322,30);
- insert into help_relation (help_topic_id,help_keyword_id) values (277,30),(354,30),(363,31),(359,31),(19,32),(83,33),(359,33),(322,33),(19,34),(271,35),(359,36),(239,37),(123,37),(277,38),(363,39);
- insert into help_relation (help_topic_id,help_keyword_id) values (359,39),(363,40),(0,40),(73,41),(152,42),(0,43),(32,44),(56,44),(73,44),(152,45),(161,46),(354,46),(152,47),(271,48),(0,49);
- insert into help_relation (help_topic_id,help_keyword_id) values (115,49),(271,49),(56,49),(322,49),(354,49),(357,50),(319,50),(32,50),(289,51),(152,52),(60,53),(371,53),(359,54),(295,55),(340,56);
- insert into help_relation (help_topic_id,help_keyword_id) values (0,57),(229,58),(197,58),(327,58),(289,58),(355,59),(350,59),(143,59),(143,60),(354,60),(19,61),(363,62),(115,62),(271,62),(115,63);
- insert into help_relation (help_topic_id,help_keyword_id) values (271,63),(28,63),(197,64),(19,65),(93,66),(106,67),(350,67),(367,68),(271,69),(161,70),(145,71),(66,71),(322,72),(58,73),(359,74);
- insert into help_relation (help_topic_id,help_keyword_id) values (115,75),(375,75),(330,76),(218,77),(101,78),(263,79),(19,80),(116,81),(144,81),(211,81),(58,82),(15,82),(131,83),(115,84),(359,84);
- insert into help_relation (help_topic_id,help_keyword_id) values (183,84),(354,84),(359,85),(354,85),(357,86),(251,86),(80,86),(361,86),(23,87),(202,87),(111,87),(169,88),(106,89),(363,89),(140,89);
- insert into help_relation (help_topic_id,help_keyword_id) values (379,89),(162,89),(56,89),(28,89),(354,89),(152,90),(201,91),(94,91),(289,91),(19,91),(263,92),(38,92),(281,92),(170,92),(359,93);
- insert into help_relation (help_topic_id,help_keyword_id) values (161,93),(354,93),(359,94),(143,95),(0,96),(35,97),(143,98),(359,99),(239,100),(152,101),(347,102),(218,103),(152,104),(101,105),(35,106);
- insert into help_relation (help_topic_id,help_keyword_id) values (250,106),(152,107),(263,108),(83,108),(347,108),(32,108),(87,108),(271,108),(276,108),(340,109),(22,109),(73,109),(0,110),(19,111),(359,112);
- insert into help_relation (help_topic_id,help_keyword_id) values (159,113),(263,114),(271,114),(263,115),(359,116),(123,117),(123,118),(322,119),(123,120),(263,121),(322,121),(192,122),(359,123),(40,124),(354,124);
- insert into help_relation (help_topic_id,help_keyword_id) values (359,125),(354,125),(126,126),(359,127),(340,128),(322,129),(32,130),(271,130),(56,130),(354,130),(277,130),(0,131),(32,131),(192,132),(152,133);
- insert into help_relation (help_topic_id,help_keyword_id) values (239,134),(384,134),(159,134),(15,134),(289,134),(126,134),(92,134),(117,135),(316,136),(263,137),(363,138),(359,138),(354,138),(111,139),(105,140);
- insert into help_relation (help_topic_id,help_keyword_id) values (263,140),(106,141),(347,142),(83,143),(322,143),(276,143),(271,144),(289,145),(359,146),(304,147),(356,148),(344,149),(93,150),(340,150),(140,150);
- insert into help_relation (help_topic_id,help_keyword_id) values (359,151),(101,152),(271,153),(0,154),(22,154),(271,154),(322,155),(152,156),(106,157),(152,158),(263,159),(147,159),(0,160),(169,161),(58,162);
- insert into help_relation (help_topic_id,help_keyword_id) values (152,162),(313,163),(354,164),(359,165),(322,165),(354,166),(271,167),(115,168),(22,168),(32,168),(56,168),(28,168),(322,168),(152,169),(359,170);
- insert into help_relation (help_topic_id,help_keyword_id) values (123,171),(372,172),(353,173),(263,174),(0,174),(57,174),(40,174),(359,174),(161,174),(354,174),(324,175),(273,176),(207,177),(357,178),(0,179);
- insert into help_relation (help_topic_id,help_keyword_id) values (197,180),(327,180),(271,181),(239,182),(384,182),(159,182),(15,182),(126,182),(92,182),(152,183),(143,184),(143,185),(295,186),(197,187),(327,187);
- insert into help_relation (help_topic_id,help_keyword_id) values (162,187),(143,188),(263,189),(281,189),(359,189),(354,189),(263,190),(40,190),(273,190),(276,190),(211,190),(359,191),(363,192),(359,192),(211,192);
- insert into help_relation (help_topic_id,help_keyword_id) values (143,193),(271,194),(359,195),(354,196),(58,197),(143,198),(252,199),(271,199),(277,199),(271,200),(240,201),(288,201),(289,201),(159,202),(58,203);
- insert into help_relation (help_topic_id,help_keyword_id) values (187,204),(359,205),(111,206),(263,207),(116,207),(123,207),(40,207),(359,207),(161,207),(359,208),(152,209),(176,210),(263,211),(345,211),(229,212);
- insert into help_relation (help_topic_id,help_keyword_id) values (263,212),(281,212),(359,213),(290,214),(107,215),(74,216),(359,217),(319,218),(28,219),(197,220),(355,221),(229,222),(281,222),(170,222),(105,222);
- insert into help_relation (help_topic_id,help_keyword_id) values (38,222),(87,222),(147,222),(345,222),(359,223),(234,224),(271,224),(152,224),(251,225),(359,226),(87,227),(101,228),(19,229),(107,230),(241,230);
- insert into help_relation (help_topic_id,help_keyword_id) values (239,231),(73,232),(19,233),(28,234),(196,234),(263,235),(100,236),(152,237),(143,238),(140,239),(347,240),(77,241),(15,241),(19,242),(143,243);
- insert into help_relation (help_topic_id,help_keyword_id) values (322,244),(354,245),(152,246),(143,247),(19,248),(152,249),(263,250),(290,250),(58,251),(87,251),(271,251),(354,252),(271,253),(152,254),(152,255);
- insert into help_relation (help_topic_id,help_keyword_id) values (271,256),(341,257),(58,258),(111,258),(143,259),(322,260),(35,261),(250,261),(152,262),(88,263),(143,264),(19,265),(106,266),(340,266),(19,267);
- insert into help_relation (help_topic_id,help_keyword_id) values (104,268),(354,269),(15,270),(40,271),(152,271),(354,271),(359,272),(0,273),(0,274),(271,274),(0,275),(263,276),(322,277),(217,278),(152,279);
- insert into help_relation (help_topic_id,help_keyword_id) values (359,280),(356,281),(289,281),(271,282),(73,283),(379,284),(263,285),(211,286),(271,287),(340,288),(359,289),(106,290),(319,291),(19,292),(152,293);
- insert into help_relation (help_topic_id,help_keyword_id) values (19,294),(363,295),(359,295),(152,295),(381,296),(340,297),(92,298),(363,299),(211,299),(37,300),(283,301),(340,302),(116,303),(238,303),(251,304);
- insert into help_relation (help_topic_id,help_keyword_id) values (359,305),(106,306),(250,306),(116,307),(144,307),(211,307),(350,308),(354,309),(359,310),(73,311),(263,312),(354,312),(32,313),(87,313),(271,313);
- insert into help_relation (help_topic_id,help_keyword_id) values (56,313),(73,313),(363,314),(115,314),(40,314),(359,314),(354,314),(359,315),(271,316),(115,317),(28,317),(375,317),(359,318),(354,318),(359,319);
- insert into help_relation (help_topic_id,help_keyword_id) values (183,319),(363,320),(359,320),(22,321),(93,322),(340,322),(263,323),(116,323),(144,323),(363,324),(283,324),(357,325),(23,326),(105,326),(170,326);
- insert into help_relation (help_topic_id,help_keyword_id) values (35,326),(250,326),(322,327),(271,328),(277,328),(354,329),(322,330),(359,331),(152,332),(330,333),(367,333),(271,333),(277,333),(357,334),(251,334);
- insert into help_relation (help_topic_id,help_keyword_id) values (22,334),(80,334),(322,334),(361,334),(143,335),(152,336),(263,337),(22,337),(380,338),(17,339),(152,340),(115,341),(271,341),(161,342),(359,343);
- insert into help_relation (help_topic_id,help_keyword_id) values (73,343),(354,343),(263,344),(229,345),(83,345),(38,345),(143,345),(202,345),(276,345),(159,346),(359,346),(359,347),(151,348),(359,349);