{"id":1390,"date":"2024-05-08T10:02:43","date_gmt":"2024-05-08T02:02:43","guid":{"rendered":"http:\/\/oneai.eu.org\/?p=1390"},"modified":"2024-05-08T10:02:43","modified_gmt":"2024-05-08T02:02:43","slug":"mysql-db-%e5%b8%b8%e7%94%a8%e5%86%85%e7%bd%ae%e5%87%bd%e6%95%b0","status":"publish","type":"post","link":"https:\/\/oneai.eu.org\/?p=1390","title":{"rendered":"mysql db \u5e38\u7528\u5185\u7f6e\u51fd\u6570"},"content":{"rendered":"<p>MYSQL\uff1a\u5e38\u7528\u5185\u7f6e\u51fd\u6570<br \/>\n\u4f4d\u7f6e\uff1aselect\u8bed\u53e5\uff0c\u53ca\u5b50\u53e5where order by having \u4e2d<br \/>\nupdate delete\u8bed\u53e5\u53ca\u5b50\u53e5<\/p>\n<p>\u51fd\u6570\u4e2d\u53ef\u4ee5\u5c06\u5b57\u6bb5\u540d\u5f53\u4f5c\u53d8\u91cf\u6765\u7528\uff0c\u53d8\u91cf\u7684\u503c\u5c31\u662f\u8be5\u5217\u5bf9\u5e94\u7684\u6240\u6709\u503c<\/p>\n<p>select concat(id,'is in',name) from cats;<\/p>\n<p>\u4e00\u3001\u5b57\u7b26\u4e32\u51fd\u6570<br \/>\nPHP\u4e2d\u7528\u7684\uff0cMYSQL\u4e2d\u5927\u90e8\u5206\u90fd\u6709<\/p>\n<pre><code>1.concat(s1,s2....sn):\u628a\u4f20\u5165\u7684\u53c2\u6570\u8fde\u63a5\u6210\u4e00\u4e2a\u5b57\u7b26\u4e32\n2.insert(str,x,y,insert):\u4ecestr\u7684x\u4f4d\u7f6e\u5f00\u59cb\uff0c\u66ff\u6362y\u957f\u5ea6\u7684\u5b57\u7b26\u4e32\u4e3ainsert\n  select insert('abcdefg',2,3,'hello');\n3.lower(str),upper(str):\u5c06\u5b57\u7b26\u4e32\u8f6c\u6362\u4e3a\u5927\u5199\uff0c\u5c0f\u5199\n4.left(str,x) right(str,x) \u8fd4\u56destr\u5de6\u8fb9\uff08\u53f3\u8fb9\uff09x\u4e2a\u5b57\u7b26\uff0cx\u4e3anull\u5219\u8fd4\u56denull\n5.lpad(str,n,pad) rpad(str,n,pad)  \u7528pad\u5bf9\u5b57\u7b26\u4e32str\u4ece\u6700\u5de6\u8fb9\uff08\u53f3\u8fb9\uff09\u8fdb\u884c\u586b\u5145\uff0c\u76f4\u5230\u603b\u957f\u5ea6\u8fbe\u5230n \n  select name,lpad(name,10,'#'),rpad(name,10,'(') from cats;\n6.trim(),ltrim(),rtrim()\u53bb\u6389\u4e24\u8fb9\uff0c\u5de6\u8fb9\uff0c\u53f3\u8fb9\u7a7a\u683c\n  select concat('1',trim('   abc   '),'2'),concat('1',ltrim('   abc   '),'2'),concat<\/code><\/pre>\n<p>('1',rtrim('   abc   '),'2')\\G;<br \/>\n7.replace(str,a,b) \u5728\u5b57\u7b26\u4e32str\u4e2d\u7528\u5b57\u7b26\u4e32b\u66ff\u6362\u6240\u6709\u7684\u5b57\u7b26\u4e32a<br \/>\n8.strcmp(s1,s2):\u5982\u679cS1\u6bd4S2\u5c0f\uff0c\u8fd4\u56de-1\uff1b\u5982\u679cS1\u6bd4S2\u5927\u5219\u8fd4\u56de1\uff1b\u5982\u679c\u76f8\u7b49\u5219\u8fd4\u56de0\uff08\u6bd4\u8f83\u7684\u662f<\/p>\n<p>ASC2\u7801\uff09<br \/>\n9.substring(str,x,y) \u8fd4\u56de\u5b57\u7b26\u4e32str\u4e2d\u4ece\u4f4d\u7f6ex\u8d77\uff0c\u957f\u5ea6\u4e3ay\u7684\u5b50\u5b57\u7b26\u4e32<\/p>\n<p>CHARSET(str) \/\/\u8fd4\u56de\u5b57\u4e32\u5b57\u7b26\u96c6<br \/>\nCONCAT (string2  [,... ]) \/\/\u8fde\u63a5\u5b57\u4e32<br \/>\nINSTR (string ,substring ) \/\/\u8fd4\u56desubstring\u9996\u6b21\u5728string\u4e2d\u51fa\u73b0\u7684\u4f4d\u7f6e,\u4e0d\u5b58\u5728\u8fd4\u56de0<br \/>\nLCASE (string2 ) \/\/\u8f6c\u6362\u6210\u5c0f\u5199<br \/>\nUCASE (string2 ) \/\/\u8f6c\u6362\u6210\u5927\u5199<br \/>\nLEFT (string2 ,length ) \/\/\u4ecestring2\u4e2d\u7684\u5de6\u8fb9\u8d77\u53d6length\u4e2a\u5b57\u7b26<br \/>\nLENGTH (string ) \/\/string\u957f\u5ea6<br \/>\nLOAD_FILE (file_name ) \/\/\u4ece\u6587\u4ef6\u8bfb\u53d6\u5185\u5bb9<br \/>\nLOCATE (substring , string  [,start_position ] ) \u540cINSTR,\u4f46\u53ef\u6307\u5b9a\u5f00\u59cb\u4f4d\u7f6e<br \/>\nLPAD (string2 ,length ,pad ) \/\/\u91cd\u590d\u7528pad\u52a0\u5728string\u5f00\u5934,\u76f4\u5230\u5b57\u4e32\u957f\u5ea6\u4e3alength<br \/>\nLTRIM (string2 ) \/\/\u53bb\u9664\u524d\u7aef\u7a7a\u683c<br \/>\nREPEAT (string2 ,count ) \/\/\u91cd\u590dcount\u6b21<br \/>\nREPLACE (str ,search_str ,replace_str ) \/\/\u5728str\u4e2d\u7528replace_str\u66ff\u6362search_str<br \/>\nRPAD (string2 ,length ,pad) \/\/\u5728str\u540e\u7528pad\u8865\u5145,\u76f4\u5230\u957f\u5ea6\u4e3alength<br \/>\nRTRIM (string2 ) \/\/\u53bb\u9664\u540e\u7aef\u7a7a\u683c<br \/>\nSTRCMP (string1 ,string2 ) \/\/\u9010\u5b57\u7b26\u6bd4\u8f83\u4e24\u5b57\u4e32\u5927\u5c0f,<br \/>\nSUBSTRING (str , position  [,length ]) \/\/\u4ecestr\u7684position\u5f00\u59cb,\u53d6length\u4e2a\u5b57\u7b26,  \u6ce8\uff1amysql\u4e2d\u5904\u7406\u5b57\u7b26\u4e32\u65f6\uff0c\u9ed8\u8ba4\u7b2c\u4e00\u4e2a\u5b57\u7b26\u4e0b\u6807\u4e3a1\uff0c\u5373\u53c2\u6570position\u5fc5\u987b\u5927\u4e8e\u7b49\u4e8e1<br \/>\nTRIM([[BOTH|LEADING|TRAILING] [padding] FROM]string2) \/\/\u53bb\u9664\u6307\u5b9a\u4f4d\u7f6e\u7684\u6307\u5b9a\u5b57\u7b26<br \/>\nRIGHT(string2,length) \/\/\u53d6string2\u6700\u540elength\u4e2a\u5b57\u7b26 SPACE(count) \/\/\u751f\u6210count\u4e2a\u7a7a\u683c<\/p>\n<p>\u4e8c\u3001\u6570\u503c\u51fd\u6570<br \/>\nabs(x):\u8fd4\u56de\u7edd\u5bf9\u503c<br \/>\nceil(x):\u8fd4\u56de\u5927\u4e8ex\u7684\u6700\u5c0f\u6574\u6570<br \/>\nfloor(x):\u8fd4\u56de\u5c0f\u4e8ex\u7684\u6700\u5927\u6574\u6570<br \/>\nmod(x,y):\u8fd4\u56dex\u4e0ey\u7684\u6a21<br \/>\nrand():\u8fd4\u56de0-1\u4e4b\u95f4\u7684\u968f\u673a\u6570   select round(rand()*100);<br \/>\nround(x,y):\u8fd4\u56de\u53c2\u6570x\u7684y\u4f4d\u5c0f\u6570\u7684\u56db\u820d\u4e94\u5165\u7ed3\u679c<br \/>\ntruncate(x,y):\u8fd4\u56de\u6570\u5b57x\u622a\u65ad\u4e3ay\u4f4d\u5c0f\u6570\u7684\u7ed3\u679c<br \/>\nBIN (decimal_number ) \/\/\u5341\u8fdb\u5236\u8f6c\u4e8c\u8fdb\u5236<br \/>\nCEILING (number2 ) \/\/\u5411\u4e0a\u53d6\u6574<br \/>\nCONV(number2,from_base,to_base) \/\/\u8fdb\u5236\u8f6c\u6362<br \/>\nFORMAT (number,decimal_places ) \/\/\u4fdd\u7559\u5c0f\u6570\u4f4d\u6570<br \/>\nHEX (DecimalNumber ) \/\/\u8f6c\u5341\u516d\u8fdb\u5236<br \/>\n\u6ce8\uff1aHEX()\u4e2d\u53ef\u4f20\u5165\u5b57\u7b26\u4e32\uff0c\u5219\u8fd4\u56de\u5176ASC-11\u7801\uff0c\u5982HEX(\u2018DEF\u2019)\u8fd4\u56de4142143 \u4e5f\u53ef\u4ee5\u4f20\u5165\u5341\u8fdb\u5236\u6574\u6570\uff0c\u8fd4\u56de\u5176\u5341\u516d\u8fdb\u5236\u7f16\u7801\uff0c\u5982HEX(25)\u8fd4\u56de19<br \/>\nLEAST (number , number2  [,..]) \/\/\u6c42\u6700\u5c0f\u503c<br \/>\n\u53ef\u4ee5\u8bbe\u5b9a\u5c0f\u6570\u4f4d\u6570\uff0c\u8fd4\u56de\u6d6e\u70b9\u578b\u6570\u636e<br \/>\nmysql&gt; select round(1.567,2);<br \/>\nSIGN (number2 ) \/\/\u8fd4\u56de\u7b26\u53f7,\u6b63\u8d1f\u62160<br \/>\nSQRT(number2) \/\/\u5f00\u5e73\u65b9<\/p>\n<p>\u4e09\u3001\u65e5\u671f\u51fd\u6570<br \/>\n\u7528PHP\u65f6\u95f4\u6233\u6765\u5b8c\u6210<br \/>\ncurdate() curtime() now();   select curdate();<br \/>\nselect unix_timestamp(now());<br \/>\nselect from_unixtime(1331110656);<br \/>\nselect week(now()),year(now());<br \/>\nselect hour(curtime()),minute(curtime());<br \/>\nselect monthname(now());<br \/>\nselect date_format(now(),&quot;%Y-%m-%d %H:%i:%s&quot;);<\/p>\n<p>ADDTIME (date2 ,time_interval ) \/\/\u5c06time_interval\u52a0\u5230date2<br \/>\nCONVERT_TZ (datetime2 ,fromTZ ,toTZ ) \/\/\u8f6c\u6362\u65f6\u533a<br \/>\nCURRENT_DATE (  ) \/\/\u5f53\u524d\u65e5\u671f<br \/>\nCURRENT_TIME (  ) \/\/\u5f53\u524d\u65f6\u95f4<br \/>\nCURRENT_TIMESTAMP (  ) \/\/\u5f53\u524d\u65f6\u95f4\u6233<br \/>\nDATE (datetime ) \/\/\u8fd4\u56dedatetime\u7684\u65e5\u671f\u90e8\u5206<br \/>\nDATE_ADD (date2 , INTERVAL d_value d_type ) \/\/\u5728date2\u4e2d\u52a0\u4e0a\u65e5\u671f\u6216\u65f6\u95f4<br \/>\nDATE_FORMAT (datetime ,FormatCodes ) \/\/\u4f7f\u7528formatcodes\u683c\u5f0f\u663e\u793adatetime<br \/>\nDATE_SUB (date2 , INTERVAL d_value d_type ) \/\/\u5728date2\u4e0a\u51cf\u53bb\u4e00\u4e2a\u65f6\u95f4<br \/>\nDATEDIFF (date1 ,date2 ) \/\/\u4e24\u4e2a\u65e5\u671f\u5dee<br \/>\nDAY (date ) \/\/\u8fd4\u56de\u65e5\u671f\u7684\u5929<br \/>\nDAYNAME (date ) \/\/\u82f1\u6587\u661f\u671f<br \/>\nDAYOFWEEK (date ) \/\/\u661f\u671f(1-7) ,1\u4e3a\u661f\u671f\u5929<br \/>\nDAYOFYEAR (date ) \/\/\u4e00\u5e74\u4e2d\u7684\u7b2c\u51e0\u5929<br \/>\nEXTRACT (interval_name  FROM date ) \/\/\u4ecedate\u4e2d\u63d0\u53d6\u65e5\u671f\u7684\u6307\u5b9a\u90e8\u5206<br \/>\nMAKEDATE (year ,day ) \/\/\u7ed9\u51fa\u5e74\u53ca\u5e74\u4e2d\u7684\u7b2c\u51e0\u5929,\u751f\u6210\u65e5\u671f\u4e32<br \/>\nMAKETIME (hour ,minute ,second ) \/\/\u751f\u6210\u65f6\u95f4\u4e32<br \/>\nMONTHNAME (date ) \/\/\u82f1\u6587\u6708\u4efd\u540d<br \/>\nNOW (  ) \/\/\u5f53\u524d\u65f6\u95f4<br \/>\nSEC_TO_TIME (seconds ) \/\/\u79d2\u6570\u8f6c\u6210\u65f6\u95f4<br \/>\nSTR_TO_DATE (string ,format ) \/\/\u5b57\u4e32\u8f6c\u6210\u65f6\u95f4,\u4ee5format\u683c\u5f0f\u663e\u793a<br \/>\nTIMEDIFF (datetime1 ,datetime2 ) \/\/\u4e24\u4e2a\u65f6\u95f4\u5dee<br \/>\nTIME_TO_SEC (time ) \/\/\u65f6\u95f4\u8f6c\u79d2\u6570]<br \/>\nWEEK (date_time [,start_of_week ]) \/\/\u7b2c\u51e0\u5468<br \/>\nYEAR (datetime ) \/\/\u5e74\u4efd<br \/>\nDAYOFMONTH(datetime) \/\/\u6708\u7684\u7b2c\u51e0\u5929<br \/>\nHOUR(datetime) \/\/\u5c0f\u65f6<br \/>\nLAST_DAY(date) \/\/date\u7684\u6708\u7684\u6700\u540e\u65e5\u671f<br \/>\nMICROSECOND(datetime) \/\/\u5fae\u79d2<br \/>\nMONTH(datetime) \/\/\u6708<br \/>\nMINUTE(datetime) \/\/\u5206<\/p>\n<p>\u56db\u3001\u5176\u5b83\u51fd\u6570(\\s\u53ef\u4ee5\u770b\u5230)<br \/>\ndatabase()  select database();<br \/>\nversion()<br \/>\nuser()<br \/>\ninet_aton(ip)  \u5c06\u5b57\u7b26\u4e32\u5730\u5740\u8f6c\u6362\u4e3a\u7f51\u7edc\u5730\u5740<br \/>\npassword()  \u5bf9mysql\u7528\u6237\u52a0\u5bc6<br \/>\nmd5() \u5bf9\u7528\u6237\u5bc6\u7801\u52a0\u5bc6<br \/>\nselect * from mysql.user \\G;<\/p>\n<p>\u4e94\u3001\u6d41\u7a0b\u63a7\u5236\u8bed\u53e5<br \/>\ncreate table salary(id int,salary decimal(9,2));<\/p>\n<pre><code>if(value,t,f);   select id,salary,if(salary>300,'high','low') from salary;\nifnull(t,f)    select id,salary,ifnull(salary,0) from salary;\ncase when [value1] then [result1]...else[default]end;\n     select case when salary<=300 then 'low' else 'high' end from salary; <\/code><\/pre>\n<hr \/>\n<h2>IF THEN ELSE END IF:<br \/>\ndelimiter \/\/<br \/>\nCREATE  PROCEDURE wage()<br \/>\nbegin<br \/>\nif (select wage from ProWage where ID=2)=1500<br \/>\nthen  update ProWage set wage=1200 where ID=2;<br \/>\nend if;<br \/>\nend\/\/<\/h2>\n<h2>CASE:<br \/>\nCREATE  PROCEDURE pro7(in para int)<br \/>\nbegin<br \/>\ncase para<br \/>\nwhen 1500 then update ProWage set wage=1200 where ID=2;<br \/>\nwhen 1200 then update ProWage set wage=1500 where ID=2;<br \/>\nelse  update ProWage set wage=2500 where ID=2;<br \/>\nend case;<br \/>\nend\/\/<\/h2>\n","protected":false},"excerpt":{"rendered":"<p>MYSQL\uff1a\u5e38\u7528\u5185\u7f6e\u51fd\u6570 \u4f4d\u7f6e\uff1aselect\u8bed\u53e5\uff0c\u53ca\u5b50\u53e5where order by having \u4e2d update delete\u8bed\u53e5\u53ca\u5b50\u53e5 \u51fd\u6570\u4e2d\u53ef\u4ee5\u5c06\u5b57\u6bb5\u540d\u5f53\u4f5c\u53d8\u91cf\u6765\u7528\uff0c\u53d8\u91cf\u7684\u503c\u5c31\u662f\u8be5\u5217\u5bf9\u5e94\u7684\u6240\u6709\u503c select concat(id,&#8217;is in&#8217;,name) from cats; \u4e00\u3001\u5b57\u7b26\u4e32\u51fd\u6570 PHP\u4e2d\u7528\u7684\uff0cMYSQL\u4e2d\u5927\u90e8\u5206\u90fd\u6709 1.concat(s1,s2&#8230;.sn):\u628a\u4f20\u5165\u7684\u53c2\u6570\u8fde\u63a5\u6210\u4e00\u4e2a\u5b57\u7b26\u4e32 2.insert(str,x,y,insert):\u4ecestr\u7684x\u4f4d\u7f6e\u5f00\u59cb\uff0c\u66ff\u6362y\u957f\u5ea6\u7684\u5b57\u7b26\u4e32\u4e3ainsert select insert(&#8216;abcdefg&#8217;,2,3,&#8217;hello&#8217;); 3.lower(str),upper(str):\u5c06\u5b57\u7b26\u4e32\u8f6c\u6362\u4e3a\u5927\u5199\uff0c\u5c0f\u5199 4.left(str,x) right(str,x) \u8fd4\u56destr\u5de6\u8fb9\uff08\u53f3\u8fb9\uff09x\u4e2a\u5b57\u7b26\uff0cx\u4e3anull\u5219\u8fd4\u56denull 5.lpad(str,n,pad) rpad(str,n,pad) \u7528pad\u5bf9\u5b57\u7b26\u4e32str\u4ece\u6700\u5de6\u8fb9\uff08\u53f3\u8fb9\uff09\u8fdb\u884c\u586b\u5145\uff0c\u76f4\u5230\u603b\u957f\u5ea6\u8fbe\u5230n select name,lpad(name,10,&#8217;#&#8217;),rpad(name,10,'(&#8216;) from cats; 6.trim(),ltrim(),rtrim()\u53bb\u6389\u4e24\u8fb9\uff0c\u5de6\u8fb9\uff0c\u53f3\u8fb9\u7a7a\u683c select concat(&#8216;1&#8217;,trim(&#8216; abc &#8216;),&#8217;2&#8217;),concat(&#8216;1&#8217;,ltrim(&#8216; abc &#8216;),&#8217;2&#8217;),concat (&#8216;1&#8217;,rtrim(&#8216; abc &#8216;),&#8217;2&#8217;)\\G; 7.replace(str,a,b) \u5728\u5b57\u7b26\u4e32str\u4e2d\u7528\u5b57\u7b26\u4e32b\u66ff\u6362\u6240\u6709\u7684\u5b57\u7b26\u4e32a 8.strcmp(s1,s2):\u5982\u679cS1\u6bd4S2\u5c0f\uff0c\u8fd4\u56de-1\uff1b\u5982\u679cS1\u6bd4S2\u5927\u5219\u8fd4\u56de1\uff1b\u5982\u679c\u76f8\u7b49\u5219\u8fd4\u56de0\uff08\u6bd4\u8f83\u7684\u662f ASC2\u7801\uff09 9.substring(str,x,y) \u8fd4\u56de\u5b57\u7b26\u4e32str\u4e2d\u4ece\u4f4d\u7f6ex\u8d77\uff0c\u957f\u5ea6\u4e3ay\u7684\u5b50\u5b57\u7b26\u4e32 CHARSET(str) \/\/\u8fd4\u56de\u5b57\u4e32\u5b57\u7b26\u96c6 CONCAT (string2 [,&#8230; ]) \/\/\u8fde\u63a5\u5b57\u4e32 INSTR (string ,substring ) \/\/\u8fd4\u56desubstring\u9996\u6b21\u5728string\u4e2d\u51fa\u73b0\u7684\u4f4d\u7f6e,\u4e0d\u5b58\u5728\u8fd4\u56de0 LCASE (string2 ) \/\/\u8f6c\u6362\u6210\u5c0f\u5199 UCASE (string2 ) \/\/\u8f6c\u6362\u6210\u5927\u5199 LEFT (string2 ,length ) \/\/\u4ecestring2\u4e2d\u7684\u5de6\u8fb9\u8d77\u53d6length\u4e2a\u5b57\u7b26 LENGTH (string ) \/\/string\u957f\u5ea6 LOAD_FILE (file_name ) \/\/\u4ece\u6587\u4ef6\u8bfb\u53d6\u5185\u5bb9 LOCATE (substring , string [,start_position ] ) \u540cINSTR,\u4f46\u53ef\u6307\u5b9a\u5f00\u59cb\u4f4d\u7f6e LPAD (string2 ,length ,pad ) \/\/\u91cd\u590d\u7528pad\u52a0\u5728string\u5f00\u5934,\u76f4\u5230\u5b57\u4e32\u957f\u5ea6\u4e3alength LTRIM (string2 ) \/\/\u53bb\u9664\u524d\u7aef\u7a7a\u683c REPEAT (string2 ,count ) \/\/\u91cd\u590dcount\u6b21 REPLACE (str ,search_str ,replace_str ) \/\/\u5728str\u4e2d\u7528replace_str\u66ff\u6362search_str RPAD (string2 ,length ,pad) \/\/\u5728str\u540e\u7528pad\u8865\u5145,\u76f4\u5230\u957f\u5ea6\u4e3alength RTRIM (string2 ) \/\/\u53bb\u9664\u540e\u7aef\u7a7a\u683c STRCMP (string1 ,string2 ) \/\/\u9010\u5b57\u7b26\u6bd4\u8f83\u4e24\u5b57\u4e32\u5927\u5c0f, SUBSTRING (str , position [,length ]) \/\/\u4ecestr\u7684position\u5f00\u59cb,\u53d6length\u4e2a\u5b57\u7b26, \u6ce8\uff1amysql\u4e2d\u5904\u7406\u5b57\u7b26\u4e32\u65f6\uff0c\u9ed8\u8ba4\u7b2c\u4e00\u4e2a\u5b57\u7b26\u4e0b\u6807\u4e3a1\uff0c\u5373\u53c2\u6570position\u5fc5\u987b\u5927\u4e8e\u7b49\u4e8e1 TRIM([[BOTH|LEADING|TRAILING] [padding] FROM]string2) \/\/\u53bb\u9664\u6307\u5b9a\u4f4d\u7f6e\u7684\u6307\u5b9a\u5b57\u7b26 RIGHT(string2,length) \/\/\u53d6string2\u6700\u540elength\u4e2a\u5b57\u7b26 SPACE(count) \/\/\u751f\u6210count\u4e2a\u7a7a\u683c \u4e8c\u3001\u6570\u503c\u51fd\u6570 abs(x):\u8fd4\u56de\u7edd\u5bf9\u503c ceil(x):\u8fd4\u56de\u5927\u4e8ex\u7684\u6700\u5c0f\u6574\u6570 floor(x):\u8fd4\u56de\u5c0f\u4e8ex\u7684\u6700\u5927\u6574\u6570 mod(x,y):\u8fd4\u56dex\u4e0ey\u7684\u6a21 rand():\u8fd4\u56de0-1\u4e4b\u95f4\u7684\u968f\u673a\u6570 select round(rand()*100); round(x,y):\u8fd4\u56de\u53c2\u6570x\u7684y\u4f4d\u5c0f\u6570\u7684\u56db\u820d\u4e94\u5165\u7ed3\u679c truncate(x,y):\u8fd4\u56de\u6570\u5b57x\u622a\u65ad\u4e3ay\u4f4d\u5c0f\u6570\u7684\u7ed3\u679c BIN (decimal_number ) \/\/\u5341\u8fdb\u5236\u8f6c\u4e8c\u8fdb\u5236 CEILING (number2 ) \/\/\u5411\u4e0a\u53d6\u6574 CONV(number2,from_base,to_base) \/\/\u8fdb\u5236\u8f6c\u6362 &#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_eb_attr":"","footnotes":""},"categories":[83],"tags":[],"class_list":["post-1390","post","type-post","status-publish","format-standard","hentry","category-mysql"],"_links":{"self":[{"href":"https:\/\/oneai.eu.org\/index.php?rest_route=\/wp\/v2\/posts\/1390","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/oneai.eu.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/oneai.eu.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/oneai.eu.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/oneai.eu.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1390"}],"version-history":[{"count":1,"href":"https:\/\/oneai.eu.org\/index.php?rest_route=\/wp\/v2\/posts\/1390\/revisions"}],"predecessor-version":[{"id":1391,"href":"https:\/\/oneai.eu.org\/index.php?rest_route=\/wp\/v2\/posts\/1390\/revisions\/1391"}],"wp:attachment":[{"href":"https:\/\/oneai.eu.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1390"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/oneai.eu.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1390"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/oneai.eu.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1390"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}