CONCAT mysql

使用方法:

CONCAT(str1,str2,…)

返回结果为连接参数产生的字符串。如有任何一个参数为NULL ,则返回值为 NULL。

使用方法:

CONCAT(str1,str2,…)

返回结果为连接参数产生的字符串。如有任何一个参数为NULL ,则返回值为 NULL。

如果所有参数均为非二进制字符串,则结果为非二进制字符串。
如果自变量中含有任一二进制字符串,则结果为一个二进制字符串。
一个数字参数被转化为与之相等的二进制字符串格式;若要避免这种情况,可使用显式类型 cast, 例如:

SELECT CONCAT(CAST(int_col AS CHAR), char_col)

MySQL的concat函数可以连接一个或者多个字符串,如

mysql> select concat('10');
+--------------+
| concat('10') |
+--------------+
| 10   |
+--------------+
1 row in set (0.00 sec)

mysql> select concat('11','22','33');
+------------------------+
| concat('11','22','33') |
+------------------------+
| 112233 |
+------------------------+
1 row in set (0.00 sec)

MySQL的concat函数在连接字符串的时候,只要其中一个是NULL,那么将返回NULLmysql> select concat('11','22',null);
+------------------------+
| concat('11','22',null) |
+------------------------+
| NULL   |
+------------------------+
1 row in set (0.00 sec)

Last modified onSunday, 14 October 2012 04:07

( ! ) Warning: count(): Parameter must be an array or an object that implements Countable in /var/www/vhosts/shan.info/httpdocs/templates/gk_publisher/html/com_k2/templates/default/item.php on line 169
Call Stack
#TimeMemoryFunctionLocation
10.0010412184{main}( ).../index.php:0
20.12344262048Joomla\CMS\Application\SiteApplication->execute( ).../index.php:49
30.12344262048Joomla\CMS\Application\SiteApplication->doExecute( ).../CMSApplication.php:196
40.331111452896Joomla\CMS\Application\SiteApplication->dispatch( ).../SiteApplication.php:233
50.331711477160Joomla\CMS\Component\ComponentHelper::renderComponent( ).../SiteApplication.php:194
60.332511532488Joomla\CMS\Component\ComponentHelper::executeComponent( ).../ComponentHelper.php:377
70.332711559888require_once( '/var/www/vhosts/shan.info/httpdocs/components/com_k2/k2.php' ).../ComponentHelper.php:402
80.340411959520K2ControllerItem->execute( ).../k2.php:64
90.340411959520K2ControllerItem->display( ).../BaseController.php:710
100.350112610224K2ControllerItem->display( ).../item.php:78
110.350112610224K2ControllerItem->display( ).../controller.php:19
120.354412981264Joomla\CMS\Cache\Controller\ViewController->get( ).../BaseController.php:663
130.356613001632K2ViewItem->display( ).../ViewController.php:102
140.430315790048K2ViewItem->display( ).../view.html.php:742
150.430315790048K2ViewItem->loadTemplate( ).../HtmlView.php:230
160.433615962984include( '/var/www/vhosts/shan.info/httpdocs/templates/gk_publisher/html/com_k2/templates/default/item.php' ).../HtmlView.php:701
  • Published in MYSQL
  • Read 1520 times

( ! ) Notice: Only variables should be assigned by reference in /var/www/vhosts/shan.info/httpdocs/templates/gk_publisher/html/com_k2/templates/default/item.php on line 478
Call Stack
#TimeMemoryFunctionLocation
10.0010412184{main}( ).../index.php:0
20.12344262048Joomla\CMS\Application\SiteApplication->execute( ).../index.php:49
30.12344262048Joomla\CMS\Application\SiteApplication->doExecute( ).../CMSApplication.php:196
40.331111452896Joomla\CMS\Application\SiteApplication->dispatch( ).../SiteApplication.php:233
50.331711477160Joomla\CMS\Component\ComponentHelper::renderComponent( ).../SiteApplication.php:194
60.332511532488Joomla\CMS\Component\ComponentHelper::executeComponent( ).../ComponentHelper.php:377
70.332711559888require_once( '/var/www/vhosts/shan.info/httpdocs/components/com_k2/k2.php' ).../ComponentHelper.php:402
80.340411959520K2ControllerItem->execute( ).../k2.php:64
90.340411959520K2ControllerItem->display( ).../BaseController.php:710
100.350112610224K2ControllerItem->display( ).../item.php:78
110.350112610224K2ControllerItem->display( ).../controller.php:19
120.354412981264Joomla\CMS\Cache\Controller\ViewController->get( ).../BaseController.php:663
130.356613001632K2ViewItem->display( ).../ViewController.php:102
140.430315790048K2ViewItem->display( ).../view.html.php:742
150.430315790048K2ViewItem->loadTemplate( ).../HtmlView.php:230
160.433615962984include( '/var/www/vhosts/shan.info/httpdocs/templates/gk_publisher/html/com_k2/templates/default/item.php' ).../HtmlView.php:701
back to top