📄 fill_help_tables.sql
字号:
insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (1,34,"HEX","Syntax:\nHEX(N_or_S)\n\nIf N_or_S is a number, returns a string representation of the\nhexadecimal value of N, where N is a longlong (BIGINT) number. This is\nequivalent to CONV(N,10,16).\n\nIf N_or_S is a string, returns a hexadecimal string representation of\nN_or_S where each character in N_or_S is converted to two hexadecimal\ndigits.\n","mysql> SELECT HEX(255);\n -> 'FF'\nmysql> SELECT 0x616263;\n -> 'abc'\nmysql> SELECT HEX('abc');\n -> 616263\n","string-functions");insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (2,34,"REPLACE","Syntax:\nREPLACE(str,from_str,to_str)\n\nReturns the string str with all occurrences of the string from_str\nreplaced by the string to_str. REPLACE() performs a case-sensitive\nmatch when searching for from_str.\n","mysql> SELECT REPLACE('www.mysql.com', 'w', 'Ww');\n -> 'WwWwWw.mysql.com'\n","string-functions");insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (3,27,"CONTAINS","Contains(g1,g2)\n\nReturns 1 or 0 to indicate whether g1 completely contains g2.\n","","functions-that-test-spatial-relationships-between-geometries");insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (4,33,"SRID","SRID(g)\n\nReturns an integer indicating the Spatial Reference System ID for the\ngeometry value g.\n\nIn MySQL, the SRID value is just an integer associated with the\ngeometry value. All calculations are done assuming Euclidean (planar)\ngeometry.\n","mysql> SELECT SRID(GeomFromText('LineString(1 1,2 2)',101));\n+-----------------------------------------------+\n| SRID(GeomFromText('LineString(1 1,2 2)',101)) |\n+-----------------------------------------------+\n| 101 |\n+-----------------------------------------------+\n","general-geometry-property-functions");insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (5,29,"CURRENT_TIMESTAMP","Syntax:\nCURRENT_TIMESTAMP, CURRENT_TIMESTAMP()\n\nCURRENT_TIMESTAMP and CURRENT_TIMESTAMP() are synonyms for NOW().\n","","date-and-time-functions");insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (6,15,"VARIANCE","Syntax:\nVARIANCE(expr)\n\nReturns the population standard variance of expr. This is an extension\nto standard SQL. The standard SQL function VAR_POP() can be used\ninstead.\n\nVARIANCE() returns NULL if there were no matching rows.\n","","group-by-functions");insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (7,15,"VAR_SAMP","Syntax:\nVAR_SAMP(expr)\n\nReturns the sample variance of expr. That is, the denominator is the\nnumber of rows minus one.\n\nVAR_SAMP() returns NULL if there were no matching rows.\n","","group-by-functions");insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (8,34,"CONCAT","Syntax:\nCONCAT(str1,str2,...)\n\nReturns the string that results from concatenating the arguments. May\nhave one or more arguments. If all arguments are non-binary strings,\nthe result is a non-binary string. If the arguments include any binary\nstrings, the result is a binary string. A numeric argument is converted\nto its equivalent binary string form; if you want to avoid that, you\ncan use an explicit type cast, as in this example:\n\nSELECT CONCAT(CAST(int_col AS CHAR), char_col);\n\nCONCAT() returns NULL if any argument is NULL.\n","mysql> SELECT CONCAT('My', 'S', 'QL');\n -> 'MySQL'\nmysql> SELECT CONCAT('My', NULL, 'QL');\n -> NULL\nmysql> SELECT CONCAT(14.3);\n -> '14.3'\n","string-functions");insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (9,31,"GEOMETRY HIERARCHY","Geometry is the base class. It is an abstract class. The instantiable\nsubclasses of Geometry are restricted to zero-, one-, and\ntwo-dimensional geometric objects that exist in two-dimensional\ncoordinate space. All instantiable geometry classes are defined so that\nvalid instances of a geometry class are topologically closed (that is,\nall defined geometries include their boundary).\n\nThe base Geometry class has subclasses for Point, Curve, Surface, and\nGeometryCollection:\n\no Point represents zero-dimensional objects.\n\no Curve represents one-dimensional objects, and has subclass\n LineString, with sub-subclasses Line and LinearRing.\n\no Surface is designed for two-dimensional objects and has subclass\n Polygon.\n\no GeometryCollection has specialized zero-, one-, and two-dimensional\n collection classes named MultiPoint, MultiLineString, and\n MultiPolygon for modeling geometries corresponding to collections of\n Points, LineStrings, and Polygons, respectively. MultiCurve and\n MultiSurface are introduced as abstract superclasses that generalize\n the collection interfaces to handle Curves and Surfaces.\n\nGeometry, Curve, Surface, MultiCurve, and MultiSurface are defined as\nnon-instantiable classes. They define a common set of methods for their\nsubclasses and are included for extensibility.\n\nPoint, LineString, Polygon, GeometryCollection, MultiPoint,\nMultiLineString, and MultiPolygon are instantiable classes.\n","","gis-geometry-class-hierarchy");insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (10,34,"CHAR FUNCTION","Syntax:\nCHAR(N,... [USING charset_name])\n\nCHAR() interprets each argument N as an integer and returns a string\nconsisting of the characters given by the code values of those\nintegers. NULL values are skipped.\nBy default, CHAR() returns a binary string. To produce a string in a\ngiven character set, use the optional USING clause:\n\nmysql> SELECT CHARSET(CHAR(0x65)), CHARSET(CHAR(0x65 USING utf8));\n+---------------------+--------------------------------+\n| CHARSET(CHAR(0x65)) | CHARSET(CHAR(0x65 USING utf8)) |\n+---------------------+--------------------------------+\n| binary | utf8 |\n+---------------------+--------------------------------+\n\nIf USING is given and the result string is illegal for the given\ncharacter set, a warning is issued. Also, if strict SQL mode is\nenabled, the result from CHAR() becomes NULL.\n","mysql> SELECT CHAR(77,121,83,81,'76');\n -> 'MySQL'\nmysql> SELECT CHAR(77,77.3,'77.3');\n -> 'MMM'\n","string-functions");insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (11,21,"DATETIME","DATETIME\n\nA date and time combination. The supported range is '1000-01-01\n00:00:00' to '9999-12-31 23:59:59'. MySQL displays DATETIME values in\n'YYYY-MM-DD HH:MM:SS' format, but allows you to assign values to\nDATETIME columns using either strings or numbers.\n","","date-and-time-type-overview");insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (12,36,"OPEN","Syntax:\nOPEN cursor_name\n\nThis statement opens a previously declared cursor.\n","","open");insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (13,26,"SHOW CREATE PROCEDURE","Syntax:\nSHOW CREATE {PROCEDURE | FUNCTION} sp_name\n\nThis statement is a MySQL extension. Similar to SHOW CREATE TABLE, it\nreturns the exact string that can be used to re-create the named\nroutine.\n","mysql> SHOW CREATE FUNCTION test.hello\\G\n*************************** 1. row ***************************\n Function: hello\n sql_mode:\nCreate Function: CREATE FUNCTION `test`.`hello`(s CHAR(20)) RETURNS CHAR(50)\nRETURN CONCAT('Hello, ',s,'!')\n","show-create-procedure");insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (14,21,"INTEGER","INTEGER[(M)] [UNSIGNED] [ZEROFILL]\n\nThis type is a synonym for INT.\n","","numeric-type-overview");insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (15,34,"LOWER","Syntax:\nLOWER(str)\n\nReturns the string str with all characters changed to lowercase\naccording to the current character set mapping. The default is latin1\n(cp1252 West European).\n","mysql> SELECT LOWER('QUADRATICALLY');\n -> 'quadratically'\n","string-functions");insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (16,22,"CREATE TRIGGER","Syntax:\nCREATE\n [DEFINER = { user | CURRENT_USER }]\n TRIGGER trigger_name trigger_time trigger_event\n ON tbl_name FOR EACH ROW trigger_stmt\n\nThis statement creates a new trigger. A trigger is a named database\nobject that is associated with a table, and that activates when a\nparticular event occurs for the table. Currently, CREATE TRIGGER\nrequires the TRIGGER privilege for the table associated with the\ntrigger. (This statement requires the SUPER privilege prior to MySQL\n5.1.6.)\n\nThe trigger becomes associated with the table named tbl_name, which\nmust refer to a permanent table. You cannot associate a trigger with a\nTEMPORARY table or a view.\n\nWhen the trigger is activated, the DEFINER clause determines the\nprivileges that apply, as described later in this section.\n\ntrigger_time is the trigger action time. It can be BEFORE or AFTER to\nindicate that the trigger activates before or after the statement that\nactivated it.\n\ntrigger_event indicates the kind of statement that activates the\ntrigger. The trigger_event can be one of the following:\n\no INSERT: The trigger is activated whenever a new row is inserted into\n the table; for example, through INSERT, LOAD DATA, and REPLACE\n statements.\n\no UPDATE: The trigger is activated whenever a row is modified; for\n example, through UPDATE statements.\n\no DELETE: The trigger is activated whenever a row is deleted from the\n table; for example, through DELETE and REPLACE statements.\n","","create-trigger");insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (17,26,"SHOW COLUMNS","Syntax:\nSHOW [FULL] COLUMNS FROM tbl_name [FROM db_name] [LIKE 'pattern']\n\nSHOW COLUMNS displays information about the columns in a given table.\nIt also works for views.\n\nThe FULL keyword causes the output to include the privileges you have\nas well as any per-column comments for each column.\n\nYou can use db_name.tbl_name as an alternative to the tbl_name FROM\ndb_name syntax. In other words, these two statements are equivalent:\n\nmysql> SHOW COLUMNS FROM mytable FROM mydb;\nmysql> SHOW COLUMNS FROM mydb.mytable;\n\nSHOW FIELDS is a synonym for SHOW COLUMNS. You can also list a table's\ncolumns with the mysqlshow db_name tbl_name command.\n\nThe DESCRIBE statement provides information similar to SHOW COLUMNS.\nSee [describe].\n","","show-columns");insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (18,29,"MONTH","Syntax:\nMONTH(date)\n\nReturns the month for date, in the range 0 to 12.\n","mysql> SELECT MONTH('1998-02-03');\n -> 2\n","date-and-time-functions");insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (19,21,"TINYINT","TINYINT[(M)] [UNSIGNED] [ZEROFILL]\n\nA very small integer. The signed range is -128 to 127. The unsigned\nrange is 0 to 255.\n","","numeric-type-overview");insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (20,26,"SHOW TRIGGERS","Syntax:\nSHOW TRIGGERS [FROM db_name] [LIKE expr]\n\nSHOW TRIGGERS lists the triggers currently defined on the MySQL server.\nThis statement requires the SUPER privilege.\n\nFor the trigger ins_sum as defined in [using-triggers], the output of\nthis statement is as shown here:\n\nmysql> SHOW TRIGGERS LIKE 'acc%'\\G\n*************************** 1. row ***************************\n Trigger: ins_sum\n Event: INSERT\n Table: account\nStatement: SET @sum = @sum + NEW.amount\n Timing: BEFORE\n Created: NULL\n sql_mode:\n Definer: myname@localhost\n","","show-triggers");insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (21,14,"MASTER_POS_WAIT","Syntax:\nMASTER_POS_WAIT(log_name,log_pos[,timeout])\n\nThis function is useful for control of master/slave synchronization. It\nblocks until the slave has read and applied all updates up to the\nspecified position in the master log. The return value is the number of\nlog events the slave had to wait for to advance to the specified\nposition. The function returns NULL if the slave SQL thread is not\nstarted, the slave's master information is not initialized, the\narguments are incorrect, or an error occurs. It returns -1 if the\ntimeout has been exceeded. If the slave SQL thread stops while\nMASTER_POS_WAIT() is waiting, the function returns NULL. If the slave\nis past the specified position, the function returns immediately.\n","","miscellaneous-functions");insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (22,34,"REGEXP","Syntax:\nexpr REGEXP pat expr RLIKE pat\n\nPerforms a pattern match of a string expression expr against a pattern\npat. The pattern can be an extended regular expression. The syntax for\nregular expressions is discussed in [regexp]. Returns 1 if expr matches\npat; otherwise it returns 0. If either expr or pat is NULL, the result\nis NULL. RLIKE is a synonym for REGEXP, provided for mSQL\ncompatibility.\n\nThe pattern need not be a literal string. For example, it can be\nspecified as a string expression or table column.\n\nNote: Because MySQL uses the C escape syntax in strings (for example,\n`\\n' to represent the newline character), you must double any `\\' that\nyou use in your REGEXP strings.\n\nREGEXP is not case sensitive, except when used with binary strings.\n","mysql> SELECT 'Monty!' REGEXP 'm%y%%';\n -> 0\nmysql> SELECT 'Monty!' REGEXP '.*';\n -> 1\nmysql> SELECT 'new*\\n*line' REGEXP 'new\\\\*.\\\\*line';\n -> 1\nmysql> SELECT 'a' REGEXP 'A', 'a' REGEXP BINARY 'A';\n -> 1 0\nmysql> SELECT 'a' REGEXP '^[a-d]';\n -> 1\n","string-comparison-functions");insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (23,36,"IF STATEMENT","Syntax:\nIF search_condition THEN statement_list\n [ELSEIF search_condition THEN statement_list] ...\n [ELSE statement_list]\nEND IF\n\nIF implements a basic conditional construct. If the search_condition\nevaluates to true, the corresponding SQL statement list is executed. If\nno search_condition matches, the statement list in the ELSE clause is\nexecuted. Each statement_list consists of one or more statements.\n\nNote: There is also an IF() function, which differs from the IF\nstatement described here. See [control-flow-functions].\n","","if-statement");insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (24,19,"^","Syntax:\n^\n\nBitwise XOR:\n","mysql> SELECT 1 ^ 1;\n -> 0\nmysql> SELECT 1 ^ 0;\n -> 1\nmysql> SELECT 11 ^ 3;\n -> 8\n","bit-functions");insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (25,37,"DROP VIEW","Syntax:\nDROP VIEW [IF EXISTS]\n view_name [, view_name] ...\n [RESTRICT | CASCADE]\n\nDROP VIEW removes one or more views. You must have the DROP privilege\nfor each view.\n\nThe IF EXISTS clause prevents an error from occurring for views that\ndon't exist. When this clause is given, a NOTE is generated for each\nnon-existent view. See [show-warnings].\n\nRESTRICT and CASCADE, if given, are parsed and ignored.\n","","drop-view");insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (26,29,"DATE OPERATIONS","Syntax:\nDATE_ADD(date,INTERVAL expr type), DATE_SUB(date,INTERVAL expr type)\n\nThese functions perform date arithmetic. date is a DATETIME or DATE\nvalue specifying the starting date. expr is an expression specifying\nthe interval value to be added or subtracted from the starting date.\nexpr is a string; it may start with a `-' for negative intervals. type\nis a keyword indicating how the expression should be interpreted.\n","mysql> SELECT '1997-12-31 23:59:59' + INTERVAL 1 SECOND;\n -> '1998-01-01 00:00:00'\nmysql> SELECT INTERVAL 1 DAY + '1997-12-31';\n -> '1998-01-01'\nmysql> SELECT '1998-01-01' - INTERVAL 1 SECOND;\n -> '1997-12-31 23:59:59'\nmysql> SELECT DATE_ADD('1997-12-31 23:59:59',\n -> INTERVAL 1 SECOND);\n -> '1998-01-01 00:00:00'\nmysql> SELECT DATE_ADD('1997-12-31 23:59:59',\n -> INTERVAL 1 DAY);\n -> '1998-01-01 23:59:59'\nmysql> SELECT DATE_ADD('1997-12-31 23:59:59',\n -> INTERVAL '1:1' MINUTE_SECOND);\n -> '1998-01-01 00:01:00'\nmysql> SELECT DATE_SUB('1998-01-01 00:00:00',\n -> INTERVAL '1 1:1:1' DAY_SECOND);\n -> '1997-12-30 22:58:59'\nmysql> SELECT DATE_ADD('1998-01-01 00:00:00',\n -> INTERVAL '-1 10' DAY_HOUR);\n -> '1997-12-30 14:00:00'\nmysql> SELECT DATE_SUB('1998-01-02', INTERVAL 31 DAY);\n -> '1997-12-02'\nmysql> SELECT DATE_ADD('1992-12-31 23:59:59.000002',\n -> INTERVAL '1.999999' SECOND_MICROSECOND);\n -> '1993-01-01 00:00:01.000001'\n","date-and-time-functions");insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (27,27,"WITHIN","Within(g1,g2)\n\nReturns 1 or 0 to indicate whether g1 is spatially within g2.\n","","functions-that-test-spatial-relationships-between-geometries");insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (28,29,"WEEK","Syntax:\nWEEK(date[,mode])\n\nThis function returns the week number for date. The two-argument form\nof WEEK() allows you to specify whether the week starts on Sunday or\nMonday and whether the return value should be in the range from 0 to 53\nor from 1 to 53. If the mode argument is omitted, the value of the\ndefault_week_format system variable is used. See\n[server-system-variables].\n","mysql> SELECT WEEK('1998-02-20');\n -> 7\nmysql> SELECT WEEK('1998-02-20',0);\n -> 7\nmysql> SELECT WEEK('1998-02-20',1);\n -> 8\nmysql> SELECT WEEK('1998-12-31',1);\n -> 53\n","date-and-time-functions");insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (29,26,"PREPARE","Syntax:\nPREPARE stmt_name FROM preparable_stmt\n\nThe PREPARE statement prepares a statement and assigns it a name,\nstmt_name, by which to refer to the statement later. Statement names\nare not case sensitive. preparable_stmt is either a string literal or a\nuser variable that contains the text of the statement. The text must\nrepresent a single SQL statement, not multiple statements. Within the\nstatement, `?' characters can be used as parameter markers to indicate\nwhere data values are to be bound to the query later when you execute\nit. The `?' characters should not be enclosed within quotes, even if\nyou intend to bind them to string values. Parameter markers can be used\nonly where data values should appear, not for SQL keywords,\nidentifiers, and so forth.\n\nIf a prepared statement with the given name already exists, it is\ndeallocated implicitly before the new statement is prepared. This means\nthat if the new statement contains an error and cannot be prepared, an\nerror is returned and no statement with the given name exists.\n\nThe scope of a prepared statement is the client session within which it\nis created. Other clients cannot see it.\n","","sqlps");insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (30,8,"LOCK","Syntax:\nLOCK TABLES\n tbl_name [AS alias] {READ [LOCAL] | [LOW_PRIORITY] WRITE}\n [, tbl_name [AS alias] {READ [LOCAL] | [LOW_PRIORITY] WRITE}] ...\nUNLOCK TABLES\n\nLOCK TABLES locks tables for the current thread. If any of the tables\nare locked by other threads, it blocks until all locks can be acquired.\nUNLOCK TABLES releases any locks held by the current thread. All tables\nthat are locked by the current thread are implicitly unlocked when the\nthread issues another LOCK TABLES, or when the connection to the server\nis closed.\n\nA table lock protects only against inappropriate reads or writes by\nother clients. The client holding the lock, even a read lock, can\nperform table-level operations such as DROP TABLE.\n","","lock-tables");insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (31,34,"UPDATEXML","Syntax:\nUpdateXML(xml_target, xpath_expr, new_xml)\n\nThis function replaces a portion of a given fragment of XML markup\nxml_target with a new XML fragment new_xml and then returns the changed\nXML. The portion of xml_target that is replaced matches an XPath\nexpression xpath_expr supplied by the user. If no expression matching\nxpath_expr is found, the function returns the original xml_target XML\nfragment. All three arguments must be strings.\n","mysql> SELECT\n -> UpdateXML('<a><b>ccc</b><d></d></a>', '/a', '<e>fff</e>') AS val1,\n -> UpdateXML('<a><b>ccc</b><d></d></a>', '/b', '<e>fff</e>') AS val2,\n -> UpdateXML('<a><b>ccc</b><d></d></a>', '//b', '<e>fff</e>') AS val3,\n -> UpdateXML('<a><b>ccc</b><d></d></a>', '/a/d', '<e>fff</e>') AS val4\n -> \\G\n\n*************************** 1. row ***************************\nval1: <e>fff</e>\nval2: <a><b>ccc</b><d></d></a>\nval3: <a><e>fff</e><d></d></a>\nval4: <a><b>ccc</b><e>fff</e></a>\n","xml-functions");
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -