USE mysql;
DROP TABLE IF EXISTS help_topic;
CREATE TABLE help_topic (  help_topic_id int unsigned not null auto_increment,  name          varchar(64) not null,  description   text not null,  example       text not null,  url           varchar(128) not null,  primary key   (help_topic_id),  unique index(name)) type=myisam;

DROP TABLE IF EXISTS help_category;
CREATE TABLE help_category (  help_category_id smallint unsigned not null auto_increment,  name             varchar(64) not null,  url              varchar(128) not null,  primary key      (help_category_id),  unique index (name)) type=myisam;

DROP TABLE IF EXISTS help_relation;
CREATE TABLE help_relation (   help_topic_id    int unsigned not null references help_topic,   help_category_id smallint unsigned not null references help_category,   primary key      (help_category_id, help_topic_id),) type=myisam;

SET @cur_category=null;

INSERT IGNORE INTO help_category (name) VALUES ('Non-Type-Specific Operators and Functions');
SET @cur_category=LAST_INSERT_ID();
INSERT IGNORE INTO help_category (name) VALUES ('Parentheses');
SET @cur_category=LAST_INSERT_ID();
INSERT IGNORE INTO help_category (name) VALUES ('Comparison Operators');
SET @cur_category=LAST_INSERT_ID();
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('=','   =\nEqual:','mysql> SELECT 1 = 0;\n        -> 0\nmysql> SELECT ''0'' = 0;\n        -> 1\nmysql> SELECT ''0.0'' = 0;\n        -> 1\nmysql> SELECT ''0.01'' = 0;\n        -> 0\nmysql> SELECT ''.01'' = 0.01;\n        -> 1');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('!=','   <>\n   !=\nNot equal:','mysql> SELECT ''.01'' <> ''0.01'';\n        -> 1\nmysql> SELECT .01 <> ''0.01'';\n        -> 0\nmysql> SELECT ''zapp'' <> ''zappp'';\n        -> 1');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('<=','   <=\nLess than or equal:','mysql> SELECT 0.1 <= 2;\n        -> 1');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('<','   <\nLess than:','mysql> SELECT 2 < 2;\n        -> 0');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('>=','   >=\nGreater than or equal:','mysql> SELECT 2 >= 2;\n        -> 1');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('>','   >\nGreater than:','mysql> SELECT 2 > 2;\n        -> 0');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('<=> ','   <=>\nNULL safe equal:','mysql> SELECT 1 <=> 1, NULL <=> NULL, 1 <=> NULL;\n        -> 1 1 0');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('IS NOT NULL','   IS NULL\n   IS NOT NULL\nTest whether a value is or is not NULL:','mysql> SELECT 1 IS NULL, 0 IS NULL, NULL IS NULL;\n        -> 0 0 1\nmysql> SELECT 1 IS NOT NULL, 0 IS NOT NULL, NULL IS NOT NULL;\n        -> 1 1 0');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('BETWEEN ... AND','   expr BETWEEN min AND max\nIf expr is greater than or equal to min and expr is\nless than or equal to max, BETWEEN returns 1,\notherwise it returns 0.  This is equivalent to the expression\n(min <= expr AND expr <= max) if all the arguments are of the\nsame type. Otherwise type conversion takes place, according to the rules\nabove, but applied to all the three arguments. Note that before\n4.0.5 arguments were converted to the type of expr instead.','mysql> SELECT 1 BETWEEN 2 AND 3;\n        -> 0\nmysql> SELECT ''b'' BETWEEN ''a'' AND ''c'';\n        -> 1\nmysql> SELECT 2 BETWEEN 2 AND ''3'';\n        -> 1\nmysql> SELECT 2 BETWEEN 2 AND ''x-3'';\n        -> 0');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('NOT BETWEEN','   expr NOT BETWEEN min AND max\nSame as NOT (expr BETWEEN min AND max).','');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('IN','   expr IN (value,...)\nReturns 1 if expr is any of the values in the IN list,\nelse returns 0.  If all values are constants, then all values are\nevaluated according to the type of expr and sorted. The search for the\nitem is then done using a binary search. This means IN is very quick\nif the IN value list consists entirely of constants.  If expr\nis a case-sensitive string expression, the string comparison is performed in\ncase-sensitive fashion:','mysql> SELECT 2 IN (0,3,5,''wefwf'');\n        -> 0\nmysql> SELECT ''wefwf'' IN (0,3,5,''wefwf'');\n        -> 1');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('NOT IN','   expr NOT IN (value,...)\nSame as NOT (expr IN (value,...)).','');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('ISNULL','   ISNULL(expr)\nIf expr is NULL, ISNULL() returns 1, otherwise\nit returns 0:','mysql> SELECT ISNULL(1+1);\n        -> 0\nmysql> SELECT ISNULL(1/0);\n        -> 1');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('COALESCE','   COALESCE(list)\nReturns first non-NULL element in list:','mysql> SELECT COALESCE(NULL,1);\n        -> 1\nmysql> SELECT COALESCE(NULL,NULL,NULL);\n        -> NULL');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('INTERVAL','   INTERVAL(N,N1,N2,N3,...)\nReturns 0 if N < N1, 1 if N < N2\nand so on. All arguments are treated as integers.  It is required that\nN1 < N2 < N3 < ... < Nn for this function\nto work correctly. This is because a binary search is used (very fast):','mysql> SELECT INTERVAL(23, 1, 15, 17, 30, 44, 200);\n        -> 3\nmysql> SELECT INTERVAL(10, 1, 10, 100, 1000);\n        -> 2\nmysql> SELECT INTERVAL(22, 23, 30, 44, 200);\n        -> 0');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_category (name) VALUES ('Logical Operators');
SET @cur_category=LAST_INSERT_ID();
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('! ','   NOT\n   !\nLogical NOT.\nEvaluates to 1 if the operand is 0,\nto 0 if the operand is non-zero,\nand NOT NULL returns NULL.','mysql> SELECT NOT 10;\n        -> 0\nmysql> SELECT NOT 0;\n        -> 1\nmysql> SELECT NOT NULL;\n        -> NULL\nmysql> SELECT ! (1+1);\n        -> 0\nmysql> SELECT ! 1+1;\n        -> 1');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('&& ','   AND\n   &&\nLogical AND.\nEvaluates to 1 if all operands are non-zero and not NULL,\nto 0 if one or more operands are 0,\notherwise NULL is returned.','mysql> SELECT 1 && 1;\n        -> 1\nmysql> SELECT 1 && 0;\n        -> 0\nmysql> SELECT 1 && NULL;\n        -> NULL\nmysql> SELECT 0 && NULL;\n        -> 0\nmysql> SELECT NULL && 0;\n        -> 0');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('|| ','   OR\n   ||\nLogical OR.\nEvaluates to 1 if any operand is non-zero,\nto NULL if any operand is NULL,\notherwise 0 is returned.','mysql> SELECT 1 || 1;\n        -> 1\nmysql> SELECT 1 || 0;\n        -> 1\nmysql> SELECT 0 || 0;\n        -> 0\nmysql> SELECT 0 || NULL;\n        -> NULL\nmysql> SELECT 1 || NULL;\n        -> 1');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_category (name) VALUES ('Control Flow Functions');
SET @cur_category=LAST_INSERT_ID();
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('IFNULL','   IFNULL(expr1,expr2)\nIf expr1 is not NULL, IFNULL() returns expr1,\nelse it returns expr2.  IFNULL() returns a numeric or string\nvalue, depending on the context in which it is used:','mysql> SELECT IFNULL(1,0);\n        -> 1\nmysql> SELECT IFNULL(NULL,10);\n        -> 10\nmysql> SELECT IFNULL(1/0,10);\n        -> 10\nmysql> SELECT IFNULL(1/0,''yes'');\n        -> ''yes''');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('NULLIF','   NULLIF(expr1,expr2)\nIf expr1 = expr2 is true, return NULL else return expr1.\nThis is the same as CASE WHEN x = y THEN NULL ELSE x END:','mysql> SELECT NULLIF(1,1);\n        -> NULL\nmysql> SELECT NULLIF(1,2);\n        -> 1');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('IF','   IF(expr1,expr2,expr3)\nIf expr1 is TRUE (expr1 <> 0 and expr1 <> NULL) then\nIF() returns expr2, else it returns expr3.\nIF() returns a numeric or string value, depending on the context\nin which it is used:','mysql> SELECT IF(1>2,2,3);\n        -> 3\nmysql> SELECT IF(1<2,''yes'',''no'');\n        -> ''yes''\nmysql> SELECT IF(STRCMP(''test'',''test1''),''no'',''yes'');\n        -> ''no''');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('CASE','   CASE value WHEN [compare-value] THEN result [WHEN [compare-value] THEN result ...] [ELSE result] END\n   CASE WHEN [condition] THEN result [WHEN [condition] THEN result ...] [ELSE result] END\n\nThe first version returns the result where\nvalue=compare-value. The second version returns the result for\nthe first condition, which is true. If there was no matching result\nvalue, then the result after ELSE is returned. If there is no\nELSE part then NULL is returned:','mysql> SELECT CASE 1 WHEN 1 THEN "one"\n           WHEN 2 THEN "two" ELSE "more" END;\n       -> "one"\nmysql> SELECT CASE WHEN 1>0 THEN "true" ELSE "false" END;\n       -> "true"\nmysql> SELECT CASE BINARY "B" WHEN "a" THEN 1 WHEN "b" THEN 2 END;\n       -> NULL');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_category (name) VALUES ('String Functions');
SET @cur_category=LAST_INSERT_ID();
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('ASCII','   ASCII(str)\nReturns the ASCII code value of the leftmost character of the string\nstr. Returns 0 if str is the empty string.  Returns\nNULL if str is NULL:','mysql> SELECT ASCII(''2'');\n        -> 50\nmysql> SELECT ASCII(2);\n        -> 50\nmysql> SELECT ASCII(''dx'');\n        -> 100');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('ORD','   ORD(str)\nIf the leftmost character of the string str is a multi-byte character,\nreturns the code for that character, calculated from the ASCII code values\nof its constituent characters using this formula:\n((first byte ASCII code)*256+(second byte ASCII code))[*256+third byte ASCII code...].\nIf the leftmost character is not a multi-byte character, returns the same\nvalue that the ASCII() function does:','mysql> SELECT ORD(''2'');\n        -> 50');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('CONV','   CONV(N,from_base,to_base)\nConverts numbers between different number bases.  Returns a string\nrepresentation of the number N, converted from base from_base\nto base to_base.  Returns NULL if any argument is NULL.\nThe argument N is interpreted as an integer, but may be specified as\nan integer or a string.  The minimum base is 2 and the maximum base is\n36.  If to_base is a negative number, N is regarded as a\nsigned number.  Otherwise, N is treated as unsigned.  CONV works\nwith 64-bit precision:','mysql> SELECT CONV("a",16,2);\n        -> ''1010''\nmysql> SELECT CONV("6E",18,8);\n        -> ''172''\nmysql> SELECT CONV(-17,10,-18);\n        -> ''-H''\nmysql> SELECT CONV(10+"10"+''10''+0xa,10,10);\n        -> ''40''');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('BIN','   BIN(N)\nReturns a string representation of the binary value of N, where\nN is a longlong (BIGINT) number.  This is equivalent to\nCONV(N,10,2).  Returns NULL if N is NULL:','mysql> SELECT BIN(12);\n        -> ''1100''');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('OCT','   OCT(N)\nReturns a string representation of the octal value of N, where\nN is a longlong number.  This is equivalent to CONV(N,10,8).\nReturns NULL if N is NULL:','mysql> SELECT OCT(12);\n        -> ''14''');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('HEX','   HEX(N_or_S)\n\nIf N_OR_S is a number, returns a string representation of the hexadecimal\nvalue of N, where N is a longlong (BIGINT) number.\nThis is equivalent to CONV(N,10,16).\n\nIf N_OR_S is a string, returns a hexadecimal string of N_OR_S where each\ncharacter in N_OR_S is converted to 2 hexadecimal digits. This is the\ninvers of the 0xff strings.','mysql> SELECT HEX(255);\n        -> ''FF''\nmysql> SELECT HEX("abc");\n        -> 616263\nmysql> SELECT 0x616263;\n        -> "abc"');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('CHAR','   CHAR(N,...)\nCHAR() interprets the arguments as integers and returns a string\nconsisting of the characters given by the ASCII code values of those\nintegers. NULL values are skipped:','mysql> SELECT CHAR(77,121,83,81,''76'');\n        -> ''MySQL''\nmysql> SELECT CHAR(77,77.3,''77.3'');\n        -> ''MMM''');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('CONCAT','   CONCAT(str1,str2,...)\nReturns the string that results from concatenating the arguments.  Returns\nNULL if any argument is NULL.  May have more than 2 arguments.\nA numeric argument is converted to the equivalent string form:','mysql> SELECT CONCAT(''My'', ''S'', ''QL'');\n        -> ''MySQL''\nmysql> SELECT CONCAT(''My'', NULL, ''QL'');\n        -> NULL\nmysql> SELECT CONCAT(14.3);\n        -> ''14.3''');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('CONCAT_WS','   CONCAT_WS(separator, str1, str2,...)\n\nCONCAT_WS() stands for CONCAT With Separator and is a special form of\nCONCAT().  The first argument is the separator for the rest of the\narguments. The separator can be a string as well as the rest of the\narguments. If the separator is NULL, the result will be NULL.\nThe function will skip any NULLs and empty strings, after the\nseparator argument. The separator will be added between the strings to be\nconcatenated:','mysql> SELECT CONCAT_WS(",","First name","Second name","Last Name");\n       -> ''First name,Second name,Last Name''\nmysql> SELECT CONCAT_WS(",","First name",NULL,"Last Name");\n       -> ''First name,Last Name''');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('CHARACTER_LENGTH','   LENGTH(str)\n   OCTET_LENGTH(str)\n   CHAR_LENGTH(str)\n   CHARACTER_LENGTH(str)\nReturns the length of the string str:','mysql> SELECT LENGTH(''text'');\n        -> 4\nmysql> SELECT OCTET_LENGTH(''text'');\n        -> 4');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('BIT_LENGTH','   BIT_LENGTH(str)\nReturns the length of the string str in bits:','mysql> SELECT BIT_LENGTH(''text'');\n        -> 32');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('POSITION','   LOCATE(substr,str)\n   POSITION(substr IN str)\nReturns the position of the first occurrence of substring substr\nin string str. Returns 0 if substr is not in str:','mysql> SELECT LOCATE(''bar'', ''foobarbar'');\n        -> 4\nmysql> SELECT LOCATE(''xbar'', ''foobar'');\n        -> 0');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('LOCATE','   LOCATE(substr,str,pos)\nReturns the position of the first occurrence of substring substr in\nstring str, starting at position pos.\nReturns 0 if substr is not in str:','mysql> SELECT LOCATE(''bar'', ''foobarbar'',5);\n        -> 7');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('INSTR','   INSTR(str,substr)\nReturns the position of the first occurrence of substring substr in\nstring str. This is the same as the two-argument form of\nLOCATE(), except that the arguments are swapped:','mysql> SELECT INSTR(''foobarbar'', ''bar'');\n        -> 4\nmysql> SELECT INSTR(''xbar'', ''foobar'');\n        -> 0');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('LPAD','   LPAD(str,len,padstr)\nReturns the string str, left-padded with the string padstr\nuntil str is len characters long. If str is longer\nthan len'' then it will be shortened to len characters.','mysql> SELECT LPAD(''hi'',4,''??'');\n        -> ''??hi''');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('RPAD','   RPAD(str,len,padstr)\nReturns the string str, right-padded with the string\npadstr until str is len characters long.  If\nstr is longer than len'' then it will be shortened to\nlen characters.','mysql> SELECT RPAD(''hi'',5,''?'');\n        -> ''hi???''');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('LEFT','   LEFT(str,len)\nReturns the leftmost len characters from the string str:','mysql> SELECT LEFT(''foobarbar'', 5);\n        -> ''fooba''');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('RIGHT','   RIGHT(str,len)\nReturns the rightmost len characters from the string str:','mysql> SELECT RIGHT(''foobarbar'', 4);\n        -> ''rbar''');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('MID','   SUBSTRING(str,pos,len)\n   SUBSTRING(str FROM pos FOR len)\n   MID(str,pos,len)\nReturns a substring len characters long from string str,\nstarting at position pos.\nThe variant form that uses FROM is ANSI SQL92 syntax:','mysql> SELECT SUBSTRING(''Quadratically'',5,6);\n        -> ''ratica''');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('SUBSTRING','   SUBSTRING(str,pos)\n   SUBSTRING(str FROM pos)\nReturns a substring from string str starting at position pos:','mysql> SELECT SUBSTRING(''Quadratically'',5);\n        -> ''ratically''\nmysql> SELECT SUBSTRING(''foobarbar'' FROM 4);\n        -> ''barbar''');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('SUBSTRING_INDEX','   SUBSTRING_INDEX(str,delim,count)\nReturns the substring from string str before count\noccurrences of the delimiter delim.\nIf count is positive, everything to the left of the final delimiter\n(counting from the left) is returned.\nIf count is negative, everything to the right of the final delimiter\n(counting from the right) is returned:','mysql> SELECT SUBSTRING_INDEX(''www.mysql.com'', ''.'', 2);\n        -> ''www.mysql''\nmysql> SELECT SUBSTRING_INDEX(''www.mysql.com'', ''.'', -2);\n        -> ''mysql.com''');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('LTRIM','   LTRIM(str)\nReturns the string str with leading space characters removed:','mysql> SELECT LTRIM(''  barbar'');\n        -> ''barbar''');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('RTRIM','   RTRIM(str)\nReturns the string str with trailing space characters removed:','mysql> SELECT RTRIM(''barbar   '');\n        -> ''barbar''');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('TRIM','   TRIM([[BOTH | LEADING | TRAILING] [remstr] FROM] str)\nReturns the string str with all remstr prefixes and/or suffixes\nremoved. If none of the specifiers BOTH, LEADING or\nTRAILING are given, BOTH is assumed. If remstr is not\nspecified, spaces are removed:','mysql> SELECT TRIM(''  bar   '');\n        -> ''bar''\nmysql> SELECT TRIM(LEADING ''x'' FROM ''xxxbarxxx'');\n        -> ''barxxx''\nmysql> SELECT TRIM(BOTH ''x'' FROM ''xxxbarxxx'');\n        -> ''bar''\nmysql> SELECT TRIM(TRAILING ''xyz'' FROM ''barxxyz'');\n        -> ''barx''');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('SOUNDEX','   SOUNDEX(str)\nReturns a soundex string from str. Two strings that sound almost the\nsame should have identical soundex strings. A standard soundex string\nis 4 characters long, but the SOUNDEX() function returns an\narbitrarily long string. You can use SUBSTRING() on the result to get\na standard soundex string.  All non-alphanumeric characters are ignored\nin the given string. All international alpha characters outside the A-Z range\nare treated as vowels:','mysql> SELECT SOUNDEX(''Hello'');\n        -> ''H400''\nmysql> SELECT SOUNDEX(''Quadratically'');\n        -> ''Q36324''');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('SPACE','   SPACE(N)\nReturns a string consisting of N space characters:','mysql> SELECT SPACE(6);\n        -> ''      ''');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('REPLACE','   REPLACE(str,from_str,to_str)\nReturns the string str with all occurrences of the string\nfrom_str replaced by the string to_str:','mysql> SELECT REPLACE(''www.mysql.com'', ''w'', ''Ww'');\n        -> ''WwWwWw.mysql.com''');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('REPEAT','   REPEAT(str,count)\nReturns a string consisting of the string str repeated count\ntimes. If count <= 0, returns an empty string. Returns NULL if\nstr or count are NULL:','mysql> SELECT REPEAT(''MySQL'', 3);\n        -> ''MySQLMySQLMySQL''');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('REVERSE','   REVERSE(str)\nReturns the string str with the order of the characters reversed:','mysql> SELECT REVERSE(''abc'');\n        -> ''cba''');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('INSERT','   INSERT(str,pos,len,newstr)\nReturns the string str, with the substring beginning at position\npos and len characters long replaced by the string\nnewstr:','mysql> SELECT INSERT(''Quadratic'', 3, 4, ''What'');\n        -> ''QuWhattic''');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('ELT','   ELT(N,str1,str2,str3,...)\nReturns str1 if N = 1, str2 if N =\n2, and so on.  Returns NULL if N is less than 1\nor greater than the number of arguments.  ELT() is the complement of\nFIELD():','mysql> SELECT ELT(1, ''ej'', ''Heja'', ''hej'', ''foo'');\n        -> ''ej''\nmysql> SELECT ELT(4, ''ej'', ''Heja'', ''hej'', ''foo'');\n        -> ''foo''');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('FIELD','   FIELD(str,str1,str2,str3,...)\nReturns the index of str in the str1, str2,\nstr3, ... list.\nReturns 0 if str is not found.\nFIELD() is the complement of ELT():','mysql> SELECT FIELD(''ej'', ''Hej'', ''ej'', ''Heja'', ''hej'', ''foo'');\n        -> 2\nmysql> SELECT FIELD(''fo'', ''Hej'', ''ej'', ''Heja'', ''hej'', ''foo'');\n        -> 0');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('FIND_IN_SET','   FIND_IN_SET(str,strlist)\nReturns a value 1 to N if the string str is in the list\nstrlist consisting of N substrings. A string list is a string\ncomposed of substrings separated by , characters. If the first\nargument is a constant string and the second is a column of type SET,\nthe FIND_IN_SET() function is optimised to use bit arithmetic!\nReturns 0 if str is not in strlist or if strlist\nis the empty string.  Returns NULL if either argument is NULL.\nThis function will not work properly if the first argument contains a\n,:','mysql> SELECT FIND_IN_SET(''b'',''a,b,c,d'');\n        -> 2');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('MAKE_SET','   MAKE_SET(bits,str1,str2,...)\nReturns a set (a string containing substrings separated by ,\ncharacters) consisting of the strings that have the corresponding bit in\nbits set.  str1 corresponds to bit 0, str2 to bit 1,\netc.  NULL strings in str1, str2, ...\nare not appended to the result:','mysql> SELECT MAKE_SET(1,''a'',''b'',''c'');\n        -> ''a''\nmysql> SELECT MAKE_SET(1 | 4,''hello'',''nice'',''world'');\n        -> ''hello,world''\nmysql> SELECT MAKE_SET(0,''a'',''b'',''c'');\n        -> ''''');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('EXPORT_SET','   EXPORT_SET(bits,on,off,[separator,[number_of_bits]])\nReturns a string where for every bit set in ''bit'', you get an ''on'' string\nand for every reset bit you get an ''off'' string. Each string is separated\nwith ''separator'' (default '','') and only ''number_of_bits'' (default 64) of\n''bits'' is used:','mysql> SELECT EXPORT_SET(5,''Y'',''N'','','',4)\n        -> Y,N,Y,N');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('LOWER','   LCASE(str)\n   LOWER(str)\nReturns the string str with all characters changed to lowercase\naccording to the current character set mapping (the default is ISO-8859-1\nLatin1):','mysql> SELECT LCASE(''QUADRATICALLY'');\n        -> ''quadratically''');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('UPPER','   UCASE(str)\n   UPPER(str)\nReturns the string str with all characters changed to uppercase\naccording to the current character set mapping (the default is ISO-8859-1\nLatin1):','mysql> SELECT UCASE(''Hej'');\n        -> ''HEJ''');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('LOAD_FILE','   LOAD_FILE(file_name)\nReads the file and returns the file contents as a string.  The file\nmust be on the server, you must specify the full pathname to the\nfile, and you must have the FILE privilege.  The file must\nbe readable by all and be smaller than max_allowed_packet.\n\nIf the file doesn''t exist or can''t be read due to one of the above reasons,\nthe function returns NULL:','mysql> UPDATE tbl_name\n           SET blob_column=LOAD_FILE("/tmp/picture")\n           WHERE id=1;');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('QUOTE','   QUOTE(str)\nQuotes a string to produce a result that can be used as a properly-escaped\ndata value in a SQL statement.  The string is returned surrounded by single\nquotes and with each instance of single quote (''), backslash (\\),\nASCII NUL, and Control-Z preceded by a backslash.  If the argument is\nNULL, the return value is the word ````NULL'''' without surrounding\nsingle quotes.\n\nThe QUOTE function was added in MySQL version 4.0.3.','mysql> SELECT QUOTE("Don''t");\n        -> ''Don\\''t!''\nmysql> SELECT QUOTE(NULL);\n        -> NULL');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_category (name) VALUES ('String Comparison Functions');
SET @cur_category=LAST_INSERT_ID();
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('LIKE','   expr LIKE pat [ESCAPE ''escape-char'']\nPattern matching using\nSQL simple regular expression comparison. Returns 1 (TRUE) or 0\n(FALSE).  With LIKE you can use the following two wildcard characters\nin the pattern:\n\n     Char 	 Description\n   % 	 Matches any number of characters, even zero characters\n   _ 	 Matches exactly one character\n  ','mysql> SELECT ''David!'' LIKE ''David_'';\n        -> 1\nmysql> SELECT ''David!'' LIKE ''%D%v%'';\n        -> 1');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('NOT LIKE','   expr NOT LIKE pat [ESCAPE ''escape-char'']\nSame as NOT (expr LIKE pat [ESCAPE ''escape-char'']).','');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('SOUNDS LIKE','   expr SOUNDS LIKE expr\nSame as SOUNDEX(expr)=SOUNDEX(expr) (available only in version 4.1 or later). \n\n    ','');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('RLIKE','   expr REGEXP pat\n   expr RLIKE pat\nPerforms a pattern match of a string expression expr against a pattern\npat.  The pattern can be an extended regular expression.\nSee also : [Regexp].  Returns 1 if expr matches pat, otherwise\nreturns 0.  RLIKE is a synonym for REGEXP, provided for\nmSQL compatibility. Note: Because MySQL uses the C escape\nsyntax in strings (for example, \\n), you must double any \\ that\nyou use in your REGEXP strings.  As of MySQL Version 3.23.4,\nREGEXP is case-insensitive for normal (not binary) strings:','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');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('NOT REGEXP','   expr NOT REGEXP pat\n   expr NOT RLIKE pat\nSame as NOT (expr REGEXP pat).','');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('STRCMP','   STRCMP(expr1,expr2)\nSTRCMP()\nreturns 0 if the strings are the same, -1 if the first\nargument is smaller than the second according to the current sort order,\nand 1 otherwise:','mysql> SELECT STRCMP(''text'', ''text2'');\n        -> -1\nmysql> SELECT STRCMP(''text2'', ''text'');\n        -> 1\nmysql> SELECT STRCMP(''text'', ''text'');\n        -> 0');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_category (name) VALUES ('Case-Sensitivity');
SET @cur_category=LAST_INSERT_ID();
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('MATCH ... AGAINST','   MATCH (col1,col2,...) AGAINST (expr)\n   MATCH (col1,col2,...) AGAINST (expr IN BOOLEAN MODE)\nMATCH ... AGAINST() is used for full-text search and returns\nrelevance - similarity measure between the text in columns\n(col1,col2,...) and the query expr. Relevance is a\npositive floating-point number. Zero relevance means no similarity.\nMATCH ... AGAINST() is available in MySQL version\n3.23.23 or later. IN BOOLEAN MODE extension was added in version\n4.0.1. For details and usage examples, see [Fulltext Search].\n  \n\n  ','');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('BINARY','   BINARY\nThe BINARY operator casts the string following it to a binary string.\nThis is an easy way to force a column comparison to be case-sensitive even\nif the column isn''t defined as BINARY or BLOB:','mysql> SELECT "a" = "A";\n        -> 1\nmysql> SELECT BINARY "a" = "A";\n        -> 0');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_category (name) VALUES ('Numeric Functions');
SET @cur_category=LAST_INSERT_ID();
INSERT IGNORE INTO help_category (name) VALUES ('Arithmetic Operations');
SET @cur_category=LAST_INSERT_ID();
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('+','   +\nAddition:','mysql> SELECT 3+5;\n        -> 8');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('-','   -\nSubtraction:','mysql> SELECT 3-5;\n        -> -2');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('*','   *\nMultiplication:','mysql> SELECT 3*5;\n        -> 15\nmysql> SELECT 18014398509481984*18014398509481984.0;\n        -> 324518553658426726783156020576256.0\nmysql> SELECT 18014398509481984*18014398509481984;\n        -> 0');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('/','   /\nDivision:','mysql> SELECT 3/5;\n        -> 0.60');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_category (name) VALUES ('Mathematical Functions');
SET @cur_category=LAST_INSERT_ID();
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('-','   -\nUnary minus. Changes the sign of the argument:','mysql> SELECT - 2;\n        -> -2');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('ABS','   ABS(X)\nReturns the absolute value of X:','mysql> SELECT ABS(2);\n        -> 2\nmysql> SELECT ABS(-32);\n        -> 32');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('SIGN','   SIGN(X)\nReturns the sign of the argument as -1, 0, or 1, depending\non whether X is negative, zero, or positive:','mysql> SELECT SIGN(-32);\n        -> -1\nmysql> SELECT SIGN(0);\n        -> 0\nmysql> SELECT SIGN(234);\n        -> 1');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('%','   MOD(N,M)\n   %\nModulo (like the % operator in C).\nReturns the remainder of N divided by M:','mysql> SELECT MOD(234, 10);\n        -> 4\nmysql> SELECT 253 % 7;\n        -> 1\nmysql> SELECT MOD(29,9);\n        -> 2\nmysql> SELECT 29 MOD 9;\n        -> 2');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('FLOOR','   FLOOR(X)\nReturns the largest integer value not greater than X:','mysql> SELECT FLOOR(1.23);\n        -> 1\nmysql> SELECT FLOOR(-1.23);\n        -> -2');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('CEILING','   CEILING(X)\nReturns the smallest integer value not less than X:','mysql> SELECT CEILING(1.23);\n        -> 2\nmysql> SELECT CEILING(-1.23);\n        -> -1');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('ROUND','   ROUND(X)\n   ROUND(X,D)\nReturns the argument X, rounded to the nearest integer.\nWith two arguments rounded to a number to D decimals.','mysql> SELECT ROUND(-1.23);\n        -> -1\nmysql> SELECT ROUND(-1.58);\n        -> -2\nmysql> SELECT ROUND(1.58);\n        -> 2\nmysql> SELECT ROUND(1.298, 1);\n        -> 1.3\nmysql> SELECT ROUND(1.298, 0);\n        -> 1');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('DIV','   DIV\nInteger division.\nSimilar to FLOOR() but safe with BIGINT values.','mysql> SELECT 5 DIV 2\n	-> 2');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('EXP','   EXP(X)\nReturns the value of e (the base of natural logarithms) raised to\nthe power of X:','mysql> SELECT EXP(2);\n        -> 7.389056\nmysql> SELECT EXP(-2);\n        -> 0.135335');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('LN','   LN(X)\nReturns the natural logarithm of X:','mysql> SELECT LN(2);\n        -> 0.693147\nmysql> SELECT LN(-2);\n        -> NULL');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('LOG','   LOG(X)\n   LOG(B,X)\nIf called with one parameter, this function returns the natural logarithm\nof X:','mysql> SELECT LOG(2);\n        -> 0.693147\nmysql> SELECT LOG(-2);\n        -> NULL');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('LOG2','   LOG2(X)\nReturns the base-2 logarithm of X:','mysql> SELECT LOG2(65536);\n        -> 16.000000\nmysql> SELECT LOG2(-100);\n        -> NULL');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('LOG10','   LOG10(X)\nReturns the base-10 logarithm of X:','mysql> SELECT LOG10(2);\n        -> 0.301030\nmysql> SELECT LOG10(100);\n        -> 2.000000\nmysql> SELECT LOG10(-100);\n        -> NULL');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('POWER','   POW(X,Y)\n   POWER(X,Y)\nReturns the value of X raised to the power of Y:','mysql> SELECT POW(2,2);\n        -> 4.000000\nmysql> SELECT POW(2,-2);\n        -> 0.250000');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('SQRT','   SQRT(X)\nReturns the non-negative square root of X:','mysql> SELECT SQRT(4);\n        -> 2.000000\nmysql> SELECT SQRT(20);\n        -> 4.472136');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('PI','   PI()\nReturns the value of PI. The default shown number of decimals is 5, but\nMySQL internally uses the full double precession for PI.','mysql> SELECT PI();\n        -> 3.141593\nmysql> SELECT PI()+0.000000000000000000;\n        -> 3.141592653589793116');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('COS','   COS(X)\nReturns the cosine of X, where X is given in radians:','mysql> SELECT COS(PI());\n        -> -1.000000');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('SIN','   SIN(X)\nReturns the sine of X, where X is given in radians:','mysql> SELECT SIN(PI());\n        -> 0.000000');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('TAN','   TAN(X)\nReturns the tangent of X, where X is given in radians:','mysql> SELECT TAN(PI()+1);\n        -> 1.557408');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('ACOS','   ACOS(X)\nReturns the arc cosine of X, that is, the value whose cosine is\nX. Returns NULL if X is not in the range -1 to\n1:','mysql> SELECT ACOS(1);\n        -> 0.000000\nmysql> SELECT ACOS(1.0001);\n        -> NULL\nmysql> SELECT ACOS(0);\n        -> 1.570796');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('ASIN','   ASIN(X)\nReturns the arc sine of X, that is, the value whose sine is\nX. Returns NULL if X is not in the range -1 to\n1:','mysql> SELECT ASIN(0.2);\n        -> 0.201358\nmysql> SELECT ASIN(''foo'');\n        -> 0.000000');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('ATAN','   ATAN(X)\nReturns the arc tangent of X, that is, the value whose tangent is\nX:','mysql> SELECT ATAN(2);\n        -> 1.107149\nmysql> SELECT ATAN(-2);\n        -> -1.107149');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('ATAN2','   ATAN(Y,X)\n   ATAN2(Y,X)\nReturns the arc tangent of the two variables X and Y. It is\nsimilar to calculating the arc tangent of Y / X, except that the\nsigns of both arguments are used to determine the quadrant of the\nresult:','mysql> SELECT ATAN(-2,2);\n        -> -0.785398\nmysql> SELECT ATAN2(PI(),0);\n        -> 1.570796');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('COT','   COT(X)\nReturns the cotangent of X:','mysql> SELECT COT(12);\n        -> -1.57267341\nmysql> SELECT COT(0);\n        -> NULL');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('RAND','   RAND()\n   RAND(N)\nReturns a random floating-point value in the range 0 to 1.0.\nIf an integer argument N is specified, it is used as the seed value\n(producing a repeatable sequence):','mysql> SELECT RAND();\n        -> 0.9233482386203\nmysql> SELECT RAND(20);\n        -> 0.15888261251047\nmysql> SELECT RAND(20);\n        -> 0.15888261251047\nmysql> SELECT RAND();\n        -> 0.63553050033332\nmysql> SELECT RAND();\n        -> 0.70100469486881');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('LEAST','   LEAST(X,Y,...)\nWith two or more arguments, returns the smallest (minimum-valued) argument.\nThe arguments are compared using the following rules:\n\n  \n  \nIf the return value is used in an INTEGER context, or all arguments\nare integer-valued, they are compared as integers.\n\n  \nIf the return value is used in a REAL context, or all arguments are\nreal-valued, they are compared as reals.\n\n  \nIf any argument is a case-sensitive string, the arguments are compared\nas case-sensitive strings.\n\n  \nIn other cases, the arguments are compared as case-insensitive strings:\n  ','mysql> SELECT LEAST(2,0);\n        -> 0\nmysql> SELECT LEAST(34.0,3.0,5.0,767.0);\n        -> 3.0\nmysql> SELECT LEAST("B","A","C");\n        -> "A"');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('GREATEST','   GREATEST(X,Y,...)\nReturns the largest (maximum-valued) argument.\nThe arguments are compared using the same rules as for LEAST:','mysql> SELECT GREATEST(2,0);\n        -> 2\nmysql> SELECT GREATEST(34.0,3.0,5.0,767.0);\n        -> 767.0\nmysql> SELECT GREATEST("B","A","C");\n        -> "C"');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('DEGREES','   DEGREES(X)\nReturns the argument X, converted from radians to degrees:','mysql> SELECT DEGREES(PI());\n        -> 180.000000');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('RADIANS','   RADIANS(X)\nReturns the argument X, converted from degrees to radians:','mysql> SELECT RADIANS(90);\n        -> 1.570796');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('TRUNCATE','   TRUNCATE(X,D)\nReturns the number X, truncated to D decimals.  If D\nis 0, the result will have no decimal point or fractional part:','mysql> SELECT TRUNCATE(1.223,1);\n        -> 1.2\nmysql> SELECT TRUNCATE(1.999,1);\n        -> 1.9\nmysql> SELECT TRUNCATE(1.999,0);\n        -> 1\nmysql> SELECT TRUNCATE(-1.999,1);\n        -> -1.9');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_category (name) VALUES ('Date and Time Functions');
SET @cur_category=LAST_INSERT_ID();
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('DAYOFWEEK','   DAYOFWEEK(date)\nReturns the weekday index\n\nfor date (1 = Sunday, 2 = Monday, ... 7 =\nSaturday).  These index values correspond to the ODBC standard.','mysql> SELECT DAYOFWEEK(''1998-02-03'');\n        -> 3');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('WEEKDAY','   WEEKDAY(date)\nReturns the weekday index for\ndate (0 = Monday, 1 = Tuesday, ... 6 = Sunday):','mysql> SELECT WEEKDAY(''1998-02-03 22:23:00'');\n        -> 1\nmysql> SELECT WEEKDAY(''1997-11-05'');\n        -> 2');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('DAYOFMONTH','   DAYOFMONTH(date)\nReturns the day of the month for date, in the range 1 to\n31:','mysql> SELECT DAYOFMONTH(''1998-02-03'');\n        -> 3');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('DAYOFYEAR','   DAYOFYEAR(date)\nReturns the day of the year for date, in the range 1 to\n366:','mysql> SELECT DAYOFYEAR(''1998-02-03'');\n        -> 34');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('MONTH','   MONTH(date)\nReturns the month for date, in the range 1 to 12:','mysql> SELECT MONTH(''1998-02-03'');\n        -> 2');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('DAYNAME','   DAYNAME(date)\nReturns the name of the weekday for date:','mysql> SELECT DAYNAME("1998-02-05");\n        -> ''Thursday''');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('MONTHNAME','   MONTHNAME(date)\nReturns the name of the month for date:','mysql> SELECT MONTHNAME("1998-02-05");\n        -> ''February''');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('QUARTER','   QUARTER(date)\nReturns the quarter of the year for date, in the range 1\nto 4:','mysql> SELECT QUARTER(''98-04-01'');\n        -> 2');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('WEEK','   WEEK(date)\n   WEEK(date,first)\nWith a single argument, returns the week for date, in the range\n0 to 53 (yes, there may be the beginnings of a week 53),\nfor locations where Sunday is the first day of the week.  The\ntwo-argument form of WEEK() allows you to specify whether the\nweek starts on Sunday or Monday and whether the return value should be in\nthe range 0-53 or 1-52.\n\nHere is a table for how the second argument works:\n\n     Value 	 Meaning\n   0		 Week starts on Sunday and return value is in range 0-53\n   1 	 Week starts on Monday and return value is in range 0-53\n   2 	 Week starts on Sunday and return value is in range 1-53\n   3 	 Week starts on Monday and return value is in range 1-53 (ISO 8601)\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');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('YEAR','   YEAR(date)\nReturns the year for date, in the range 1000 to 9999:','mysql> SELECT YEAR(''98-02-03'');\n        -> 1998');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('HOUR','   HOUR(time)\nReturns the hour for time, in the range 0 to 23:','mysql> SELECT HOUR(''10:05:03'');\n        -> 10');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('MINUTE','   MINUTE(time)\nReturns the minute for time, in the range 0 to 59:','mysql> SELECT MINUTE(''98-02-03 10:05:03'');\n        -> 5');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('SECOND','   SECOND(time)\nReturns the second for time, in the range 0 to 59:','mysql> SELECT SECOND(''10:05:03'');\n        -> 3');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('PERIOD_ADD','   PERIOD_ADD(P,N)\nAdds N months to period P (in the format YYMM or\nYYYYMM). Returns a value in the format YYYYMM.\n\nNote that the period argument P is not a date value:','mysql> SELECT PERIOD_ADD(9801,2);\n        -> 199803');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('PERIOD_DIFF','   PERIOD_DIFF(P1,P2)\nReturns the number of months between periods P1 and P2.\nP1 and P2 should be in the format YYMM or YYYYMM.\n\nNote that the period arguments P1 and P2 are not\ndate values:','mysql> SELECT PERIOD_DIFF(9802,199703);\n        -> 11');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('SUBDATE','   DATE_ADD(date,INTERVAL expr type)\n   DATE_SUB(date,INTERVAL expr type)\n   ADDDATE(date,INTERVAL expr type)\n   SUBDATE(date,INTERVAL expr type)\n\nThese functions perform date arithmetic.  ADDDATE() and\nSUBDATE() are synonyms for DATE_ADD() and\nDATE_SUB().\n\nIn MySQL Version 3.23, you can use + and - instead of\nDATE_ADD() and DATE_SUB() if the expression on the right side is\na date or datetime column. (See example below.)\n\ndate is a DATETIME or DATE value specifying the starting\ndate.  expr is an expression specifying the interval value to be added\nor subtracted from the starting date.  expr is a string; it may start\nwith a - for negative intervals.  type is a keyword indicating\nhow the expression should be interpreted.\n\nThe following table shows how the type and expr arguments\nare related:\n\n     type value 	 Expected expr format\n   SECOND        	 SECONDS\n   MINUTE        	 MINUTES\n   HOUR          	 HOURS\n   DAY           	 DAYS\n   MONTH         	 MONTHS\n   YEAR          	 YEARS\n   MINUTE_SECOND 	 "MINUTES:SECONDS"\n   HOUR_MINUTE   	 "HOURS:MINUTES"\n   DAY_HOUR      	 "DAYS HOURS"\n   YEAR_MONTH    	 "YEARS-MONTHS"\n   HOUR_SECOND   	 "HOURS:MINUTES:SECONDS"\n   DAY_MINUTE    	 "DAYS HOURS:MINUTES"\n   DAY_SECOND    	 "DAYS HOURS:MINUTES:SECONDS"\n  \n\nMySQL allows any punctuation delimiter in the expr format.\nThose shown in the table are the suggested delimiters.  If the date\nargument is a DATE value and your calculations involve only\nYEAR, MONTH, and DAY parts (that is, no time parts), the\nresult is a DATE value.  Otherwise, the result is a DATETIME\nvalue:','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');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('EXTRACT','   EXTRACT(type FROM date)\n\nThe EXTRACT() function uses the same kinds of interval type\nspecifiers as DATE_ADD() or DATE_SUB(), but extracts parts\nfrom the date rather than performing date arithmetic.','mysql> SELECT EXTRACT(YEAR FROM "1999-07-02");\n       -> 1999\nmysql> SELECT EXTRACT(YEAR_MONTH FROM "1999-07-02 01:02:03");\n       -> 199907\nmysql> SELECT EXTRACT(DAY_MINUTE FROM "1999-07-02 01:02:03");\n       -> 20102');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('TO_DAYS','   TO_DAYS(date)\nGiven a date date, returns a daynumber (the number of days since year\n0):','mysql> SELECT TO_DAYS(950501);\n        -> 728779\nmysql> SELECT TO_DAYS(''1997-10-07'');\n        -> 729669');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('FROM_DAYS','   FROM_DAYS(N)\nGiven a daynumber N, returns a DATE value:','mysql> SELECT FROM_DAYS(729669);\n        -> ''1997-10-07''');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('DATE_FORMAT','   DATE_FORMAT(date,format)\nFormats the date value according to the format string. The\nfollowing specifiers may be used in the format string:\n     Specifier 	 Description\n   %M 	 Month name (January..December)\n   %W 	 Weekday name (Sunday..Saturday)\n   %D 	 Day of the month with English suffix (0th, 1st, 2nd, 3rd, etc.)\n   %Y 	 Year, numeric, 4 digits\n   %y 	 Year, numeric, 2 digits\n   %X 	 Year for the week where Sunday is the first day of the week, numeric, 4 digits, used with ''%V''\n   %x 	 Year for the week, where Monday is the first day of the week, numeric, 4 digits, used with ''%v''\n   %a 	 Abbreviated weekday name (Sun..Sat)\n   %d 	 Day of the month, numeric (00..31)\n   %e 	 Day of the month, numeric (0..31)\n   %m 	 Month, numeric (00..12)\n   %c 	 Month, numeric (0..12)\n   %b 	 Abbreviated month name (Jan..Dec)\n   %j 	 Day of year (001..366)\n   %H 	 Hour (00..23)\n   %k 	 Hour (0..23)\n   %h 	 Hour (01..12)\n   %I 	 Hour (01..12)\n   %l 	 Hour (1..12)\n   %i 	 Minutes, numeric (00..59)\n   %r 	 Time, 12-hour (hh:mm:ss [AP]M)\n   %T 	 Time, 24-hour (hh:mm:ss)\n   %S 	 Seconds (00..59)\n   %s 	 Seconds (00..59)\n   %p 	 AM or PM\n   %w 	 Day of the week (0=Sunday..6=Saturday)\n   %U 	 Week (00..53), where Sunday is the first day of the week\n   %u 	 Week (00..53), where Monday is the first day of the week\n   %V 	 Week (01..53), where Sunday is the first day of the week. Used with ''%X''\n   %v 	 Week (01..53), where Monday is the first day of the week. Used with ''%x''\n   %% 	 A literal %.\n  \n\nAll other characters are just copied to the result without interpretation:','mysql> SELECT DATE_FORMAT(''1997-10-04 22:23:00'', ''%W %M %Y'');\n        -> ''Saturday October 1997''\nmysql> SELECT DATE_FORMAT(''1997-10-04 22:23:00'', ''%H:%i:%s'');\n        -> ''22:23:00''\nmysql> SELECT DATE_FORMAT(''1997-10-04 22:23:00'',\n                          ''%D %y %a %d %m %b %j'');\n        -> ''4th 97 Sat 04 10 Oct 277''\nmysql> SELECT DATE_FORMAT(''1997-10-04 22:23:00'',\n                          ''%H %k %I %r %T %S %w'');\n        -> ''22 22 10 10:23:00 PM 22:23:00 00 6''\nmysql> SELECT DATE_FORMAT(''1999-01-01'', ''%X %V'');\n        -> ''1998 52''');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('TIME_FORMAT','   TIME_FORMAT(time,format)\nThis is used like the DATE_FORMAT() function above, but the\nformat string may contain only those format specifiers that handle\nhours, minutes, and seconds.  Other specifiers produce a NULL value or\n0.','');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('CURRENT_DATE','   CURDATE()\n   CURRENT_DATE\nReturns today''s date as a value in ''YYYY-MM-DD'' or YYYYMMDD\nformat, depending on whether the function is used in a string or numeric\ncontext:','mysql> SELECT CURDATE();\n        -> ''1997-12-15''\nmysql> SELECT CURDATE() + 0;\n        -> 19971215');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('CURRENT_TIME','   CURTIME()\n   CURRENT_TIME\nReturns the current time as a value in ''HH:MM:SS'' or HHMMSS\nformat, depending on whether the function is used in a string or numeric\ncontext:','mysql> SELECT CURTIME();\n        -> ''23:50:26''\nmysql> SELECT CURTIME() + 0;\n        -> 235026');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('CURRENT_TIMESTAMP','   NOW()\n   SYSDATE()\n   CURRENT_TIMESTAMP\nReturns the current date and time as a value in ''YYYY-MM-DD HH:MM:SS''\nor YYYYMMDDHHMMSS format, depending on whether the function is used in\na string or numeric context:','mysql> SELECT NOW();\n        -> ''1997-12-15 23:50:26''\nmysql> SELECT NOW() + 0;\n        -> 19971215235026');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('UNIX_TIMESTAMP','   UNIX_TIMESTAMP()\n   UNIX_TIMESTAMP(date)\nIf called with no argument, returns a Unix timestamp (seconds since\n''1970-01-01 00:00:00'' GMT) as an unsigned integer. If\nUNIX_TIMESTAMP() is called with a date argument, it\nreturns the value of the argument as seconds since ''1970-01-01\n00:00:00'' GMT.  date may be a DATE string, a\nDATETIME string, a TIMESTAMP, or a number in the format\nYYMMDD or YYYYMMDD in local time:','mysql> SELECT UNIX_TIMESTAMP();\n        -> 882226357\nmysql> SELECT UNIX_TIMESTAMP(''1997-10-04 22:23:00'');\n        -> 875996580');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('FROM_UNIXTIME','   FROM_UNIXTIME(unix_timestamp [,format])\nReturns a representation of the unix_timestamp argument as a value in\n''YYYY-MM-DD HH:MM:SS'' or YYYYMMDDHHMMSS format, depending on\nwhether the function is used in a string or numeric context:\n\nIf format is given the restult is formatted according to the\nformat string. format may contain the same specifiers as\nthose listed in the entry for the DATE_FORMAT() function','mysql> SELECT FROM_UNIXTIME(875996580);\n        -> ''1997-10-04 22:23:00''\nmysql> SELECT FROM_UNIXTIME(875996580) + 0;\n        -> 19971004222300\nmysql> SELECT FROM_UNIXTIME(UNIX_TIMESTAMP(),\n                            ''%Y %D %M %h:%i:%s %x'');\n        -> ''1997 23rd December 03:43:30 1997''');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('SEC_TO_TIME','   SEC_TO_TIME(seconds)\nReturns the seconds argument, converted to hours, minutes, and seconds,\nas a value in ''HH:MM:SS'' or HHMMSS format, depending on whether\nthe function is used in a string or numeric context:','mysql> SELECT SEC_TO_TIME(2378);\n        -> ''00:39:38''\nmysql> SELECT SEC_TO_TIME(2378) + 0;\n        -> 3938');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('TIME_TO_SEC','   TIME_TO_SEC(time)\nReturns the time argument, converted to seconds:','mysql> SELECT TIME_TO_SEC(''22:23:00'');\n        -> 80580\nmysql> SELECT TIME_TO_SEC(''00:39:38'');\n        -> 2378');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_category (name) VALUES ('Cast Functions');
SET @cur_category=LAST_INSERT_ID();
INSERT IGNORE INTO help_category (name) VALUES ('Other Functions');
SET @cur_category=LAST_INSERT_ID();
INSERT IGNORE INTO help_category (name) VALUES ('Bit Functions');
SET @cur_category=LAST_INSERT_ID();
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('<< ','   <<\nShifts a longlong (BIGINT) number to the left:','mysql> SELECT 1 << 2;\n        -> 4');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('>> ','   >>\nShifts a longlong (BIGINT) number to the right:','mysql> SELECT 4 >> 2;\n        -> 1');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('~','   ~\nInvert all bits:','mysql> SELECT 5 & ~1;\n        -> 4');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('BIT_COUNT','   BIT_COUNT(N)\nReturns the number of bits that are set in the argument N:','mysql> SELECT BIT_COUNT(29);\n        -> 4');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_category (name) VALUES ('Miscellaneous Functions');
SET @cur_category=LAST_INSERT_ID();
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('DATABASE','   DATABASE()\nReturns the current database name:','mysql> SELECT DATABASE();\n        -> ''test''');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('SESSION_USER','   USER()\n   SYSTEM_USER()\n   SESSION_USER()\nReturns the current MySQL user name:','mysql> SELECT USER();\n        -> ''davida@@localhost''');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('CURRENT_USER','   CURRENT_USER()\nReturns the user name, current session was authentificated as:','mysql> SELECT USER();\n        -> ''davida@@localhost''\nmysql> SELECT * FROM mysql.user;\n        -> ERROR 1044: Access denied for user: ''@@localhost'' to database ''mysql''\nmysql> SELECT CURRENT_USER();\n        -> ''@@localhost''');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('OLD_PASSWORD','   PASSWORD(str)\n   OLD_PASSWORD(str)\nCalculates a password string from the plaintext password str. This is\nthe function that is used for encrypting MySQL passwords for storage\nin the Password column of the user grant table:','mysql> SELECT PASSWORD(''badpwd'');\n        -> ''7f84554057dd964b''');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('ENCRYPT','   ENCRYPT(str[,salt])\nEncrypt str using the Unix crypt() system call. The\nsalt argument should be a string with two characters.\n(As of MySQL Version 3.22.16, salt may be longer than two characters.):','mysql> SELECT ENCRYPT("hello");\n        -> ''VxuFAJXVARROc''');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('ENCODE','   ENCODE(str,pass_str)\nEncrypt str using pass_str as the password.\nTo decrypt the result, use DECODE().\n\nThe results is a binary string of the same length as string.\nIf you want to save it in a column, use a BLOB column type.','');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('DECODE','   DECODE(crypt_str,pass_str)\nDescrypts the encrypted string crypt_str using pass_str as the\npassword.  crypt_str should be a string returned from\nENCODE().','');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('MD5','   MD5(string)\nCalculates an MD5 128 bit checksum for the string. The value is returned\nas a 32 digit hex number that may, for example, be used as a hash key:','mysql> SELECT MD5("testing");\n        -> ''ae2b1fca515949e5d54fb22b8ed95575''');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('SHA','   SHA1(string)\n   SHA(string)\nCalculates an SHA1 160 bit checksum for the string, as described in\nRFC 3174 (Secure Hash Algorithm). The value is returned as a 40 digit\nhex number, or NULL in case the input argument was NULL.\nOne of the possible uses for this function is as a hash key. You can\nalso use it as cryptographically safe function for storing passwords.','mysql> SELECT SHA1("abc");\n        -> ''a9993e364706816aba3e25717850c26c9cd0d89d''');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('AES_DECRYPT','   AES_ENCRYPT(string,key_string)\n   AES_DECRYPT(string,key_string)\nThese functions allow encryption/decryption of data using the official\nAES (Advanced Encryption Standard) algorithm, previously known as Rijndael.\nEncoding with 128 bit key length is used, but you can extend it up to\n256 bit by patching the source. We chose 128 bits because it is much\nfaster and it is usually secure enough.\n\nThe input arguments may be any length. If either argument is NULL,\nthe result of this function is also NULL.\n\nAs AES is a block level algorithm, padding is used to encode uneven length\nstrings and so the result string length may be calculated as\n16*(trunc(string_length/16)+1).\n\nIf AES_DECRYPT() detects invalid data or incorrect padding, it\nwill return NULL. However, it is possible for AES_DECRYPT()\nto return a non-NULL value (possibly garbage) if the input data or\nthe key was invalid.\n\nYou can use the AES functions to store data in an encrypted form by\nmodifying your queries:','INSERT INTO t VALUES (1,AES_ENCRYPT("text","password"));');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('DES_ENCRYPT','   DES_ENCRYPT(string_to_encrypt [, (key_number | key_string) ] )\n\nEncrypts the string with the given key using the Triple-DES algorithm.\n\nNote that this function only works if you have configured MySQL with\nSSL support. See also : [Secure connections].\n\nThe encryption key to use is chosen the following way:\n\n     Argument 	 Description\n   Only one argument 	\nThe first key from des-key-file is used.\n   key number 	\nThe given key (0-9) from the des-key-file is used.\n   string 	\nThe given key_string will be used to crypt string_to_encrypt.\n  \n\nThe return string will be a binary string where the first character\nwill be CHAR(128 | key_number).\n\nThe 128 is added to make it easier to recognise an encrypted key.\nIf you use a string key, key_number will be 127.\n\nOn error, this function returns NULL.\n\nThe string length for the result will be\nnew_length= org_length + (8-(org_length % 8))+1.\n\nThe des-key-file has the following format:','key_number des_key_string\nkey_number des_key_string');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('DES_DECRYPT','   DES_DECRYPT(string_to_decrypt [, key_string])\n\nDecrypts a string encrypted with DES_ENCRYPT().\n\nNote that this function only works if you have configured MySQL with\nSSL support. See also : [Secure connections].\n\nIf no key_string argument is given, DES_DECRYPT() examines\nthe first byte of the encrypted string to determine the DES key number\nthat was used to encrypt the original string, then reads the key\nfrom the des-key-file to decrypt the message.  For this to work\nthe user must have the SUPER privilege.\n\nIf you pass this function a key_string argument, that string\nis used as the key for decrypting the message.\n\nIf the string_to_decrypt doesn''t look like an encrypted string, MySQL\nwill return the given string_to_decrypt.\n\nOn error, this function returns NULL.','');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('LAST_INSERT_ID','   LAST_INSERT_ID([expr])\nReturns the last automatically generated value that was inserted into an\nAUTO_INCREMENT column.\nSee also : [mysql_insert_id,, mysql_insert_id()].','mysql> SELECT LAST_INSERT_ID();\n        -> 195');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('FORMAT','   FORMAT(X,D)\nFormats the number X to a format like ''#,###,###.##'', rounded\nto D decimals.  If D is 0, the result will have no\ndecimal point or fractional part:','mysql> SELECT FORMAT(12332.123456, 4);\n        -> ''12,332.1235''\nmysql> SELECT FORMAT(12332.1,4);\n        -> ''12,332.1000''\nmysql> SELECT FORMAT(12332.2,0);\n        -> ''12,332''');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('VERSION','   VERSION()\nReturns a string indicating the MySQL server version:','mysql> SELECT VERSION();\n        -> ''3.23.13-log''');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('CONNECTION_ID','   CONNECTION_ID()\nReturns the connection id (thread_id) for the connection.\nEvery connection has its own unique id:','mysql> SELECT CONNECTION_ID();\n        -> 1');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('GET_LOCK','   GET_LOCK(str,timeout)\nTries to obtain a lock with a name given by the string str, with a\ntimeout of timeout seconds.  Returns 1 if the lock was obtained\nsuccessfully, 0 if the attempt timed out, or NULL if an error\noccurred (such as running out of memory or the thread was killed with\nmysqladmin kill).  A lock is released when you execute\nRELEASE_LOCK(), execute a new GET_LOCK(), or the thread\nterminates.  This function can be used to implement application locks or to\nsimulate record locks.  It blocks requests by other clients for locks with\nthe same name; clients that agree on a given lock string name can use the\nstring to perform cooperative advisory locking:','mysql> SELECT GET_LOCK("lock1",10);\n        -> 1\nmysql> SELECT IS_FREE_LOCK("lock2");\n        -> 1\nmysql> SELECT GET_LOCK("lock2",10);\n        -> 1\nmysql> SELECT RELEASE_LOCK("lock2");\n        -> 1\nmysql> SELECT RELEASE_LOCK("lock1");\n        -> NULL');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('RELEASE_LOCK','   RELEASE_LOCK(str)\nReleases the lock named by the string str that was obtained with\nGET_LOCK(). Returns 1 if the lock was released, 0 if the\nlock wasn''t locked by this thread (in which case the lock is not released),\nand NULL if the named lock didn''t exist.  The lock will not exist if\nit was never obtained by a call to GET_LOCK() or if it already has\nbeen released.\n\nThe DO statement is convinient to use with RELEASE_LOCK().\nSee also : [DO].','');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('IS_FREE_LOCK','   IS_FREE_LOCK(str)\nChecks if the lock named str is free to use (i.e., not locked).\nReturns 1 if the lock is free (no one is using the lock),\n0 if the lock is in use, and\nNULL on errors (like incorrect arguments).','');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('BENCHMARK','   BENCHMARK(count,expr)\nThe BENCHMARK() function executes the expression expr\nrepeatedly count times.  It may be used to time how fast MySQL\nprocesses the expression.  The result value is always 0.  The intended\nuse is in the mysql client, which reports query execution times:','mysql> SELECT BENCHMARK(1000000,ENCODE("hello","goodbye"));\n+----------------------------------------------+\n| BENCHMARK(1000000,ENCODE("hello","goodbye")) |\n+----------------------------------------------+\n|                                            0 |\n+----------------------------------------------+\n1 row in set (4.74 sec)');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('INET_NTOA','   INET_NTOA(expr)\nGiven a numeric network address (4 or 8 byte), returns the dotted-quad\nrepresentation of the address as a string:','mysql> SELECT INET_NTOA(3520061480);\n       ->  "209.207.224.40"');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('INET_ATON','   INET_ATON(expr)\nGiven the dotted-quad representation of a network address as a string,\nreturns an integer that represents the numeric value of the address.\nAddresses may be 4 or 8 byte addresses:','mysql> SELECT INET_ATON("209.207.224.40");\n       ->  3520061480');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('MASTER_POS_WAIT','   MASTER_POS_WAIT(log_name, log_pos)\n\nBlocks until the slave reaches (i.e. has read and applied all updates up\nto) the specified position in the master log. If master information is\nnot initialised, or if the arguments are incorrect, returns\nNULL. If the slave is not running, will block and wait until it\nis started and goes to or past the specified position. If the slave is\nalready past the specified position, returns immediately.\n\nIf timeout (new in 4.0.10) is specified, will give up waiting\nwhen timeout seconds have elapsed. timeout must be greater\nthan 0; a zero or negative timeout means no timeout.  The return\nvalue is the number of log events it had to wait to get to the specified\nposition, or NULL in case of error, or -1 if the timeout\nhas been exceeded.\n\nThis command is useful for control of master-slave synchronisation, but\nwas originally written to facilitate replication testing.','');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('LIMIT','   FOUND_ROWS()\nReturns the number of rows that the last SELECT SQL_CALC_FOUND_ROWS ...\ncommand would have returned, if it had not been restricted with LIMIT.','mysql> SELECT SQL_CALC_FOUND_ROWS * FROM tbl_name\n       WHERE id > 100 LIMIT 10;\nmysql> SELECT FOUND_ROWS();');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_category (name) VALUES ('Functions for Use with GROUP BY Clauses');
SET @cur_category=LAST_INSERT_ID();
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('COUNT','   COUNT(expr)\nReturns a count of the number of non-NULL values in the rows\nretrieved by a SELECT statement:','mysql> SELECT student.student_name,COUNT(*)\n    ->        FROM student,course\n    ->        WHERE student.student_id=course.student_id\n    ->        GROUP BY student_name;');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('DISTINCT','   COUNT(DISTINCT expr,[expr...])\nReturns a count of the number of different non-NULL values:','mysql> SELECT COUNT(DISTINCT results) FROM student;');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('AVG','   AVG(expr)\nReturns the average value of expr:','mysql> SELECT student_name, AVG(test_score)\n    ->        FROM student\n    ->        GROUP BY student_name;');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('MAX','   MIN(expr)\n   MAX(expr)\nReturns the minimum or maximum value of expr.  MIN() and\nMAX() may take a string argument; in such cases they return the\nminimum or maximum string value. See also : [MySQL indexes].','mysql> SELECT student_name, MIN(test_score), MAX(test_score)\n    ->        FROM student\n    ->        GROUP BY student_name;');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('SUM','   SUM(expr)\nReturns the sum of expr.  Note that if the return set has no rows,\nit returns NULL!','');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('VARIANCE','   VARIANCE(expr)\nReturns the standard variance of expr. This is an extension to\nANSI SQL (available only in version 4.1 or later).','');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('STDDEV','       STD(expr)\n   STDDEV(expr)\nReturns the standard deviation of expr. This is an extension to\nANSI SQL. The STDDEV() form of this function is provided for Oracle\ncompatibility.','');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('BIT_OR','   BIT_OR(expr)\nReturns the bitwise OR of all bits in expr. The calculation is\nperformed with 64-bit (BIGINT) precision.','');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
INSERT IGNORE INTO help_topic (name,description,example) VALUES ('BIT_AND','   BIT_AND(expr)\nReturns the bitwise AND of all bits in expr. The calculation is\nperformed with 64-bit (BIGINT) precision.\n  \n\n  MySQL has extended the use of GROUP BY. You can use columns or\ncalculations in the SELECT expressions that don''t appear in\nthe GROUP BY part. This stands for /any possible value for this\ngroup/.  You can use this to get better performance by avoiding sorting and\ngrouping on unnecessary items.  For example, you don''t need to group on\ncustomer.name in the following query:','mysql> SELECT order.custid,customer.name,MAX(payments)\n    ->        FROM order,customer\n    ->        WHERE order.custid = customer.custid\n    ->        GROUP BY order.custid;');
INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (@cur_category,LAST_INSERT_ID());
DELETE help_category FROM help_category LEFT JOIN help_relation ON help_category.help_category_id=help_relation.help_category_id WHERE help_relation.help_category_id is null;
