当前位置: 首页 > news >正文

光明乳业网站建设情况平台推广计划

光明乳业网站建设情况,平台推广计划,外链网站 英文,微营销方案1.concat concat()函数是将多个字符串组合在一起,形成一个大的字符串;如果连接的字符串中存在一个为NULL,则输出的结果为NULL,语法格式为: concat(str1,str2,....strn) -- 1、字符之间不加连接符 mysql> select c…


1.concat 
concat()函数是将多个字符串组合在一起,形成一个大的字符串;如果连接的字符串中存在一个为NULL,则输出的结果为NULL,语法格式为:
concat(str1,str2,....strn)

-- 1、字符之间不加连接符
mysql> select concat("01","赵雷","男");
+-----------------------------+
| concat("01","赵雷","男")    |
+-----------------------------+
| 01赵雷男                    |
+-----------------------------+
1 row in set (0.00 sec)-- 2、字符之间添加连接符
mysql> select concat("01-","赵雷-","男");
+-------------------------------+
| concat("01-","赵雷-","男")    |
+-------------------------------+
| 01-赵雷-男                    |
+-------------------------------+
1 row in set (0.00 sec)-- 3、忽略空字符串
mysql> mysql> select concat("01","赵雷","","男");
+--------------------------------+
| concat("01","赵雷","","男")    |
+--------------------------------+
| 01赵雷男                       |
+--------------------------------+
1 row in set (0.00 sec)-- 4、存在NULL的情况
mysql> select concat("01","赵雷",NULL,"男");  -- 结果直接显示为NULL
+----------------------------------+
| concat("01","赵雷",NULL,"男")    |
+----------------------------------+
| NULL                             |
+----------------------------------+
1 row in set (0.01 sec)

上面的NULLMySQLNULL,如果NULL本身就是字符串,则结果不相同:

mysql> select concat("01","赵雷","NULL","男");
+------------------------------------+
| concat("01","赵雷","NULL","男")    |
+------------------------------------+
| 01赵雷NULL男                       |
+------------------------------------+
1 row in set (0.01 sec)

2.concat_ws
concat_ws()函数相比较于concat()多了一个指定的连接符号,语法为:
concat_ws(separator, str1, str2, str3)

-- 1、指定不同的连接符号:分别指定逗号和加号mysql> select concat_ws(",","01","赵雷","男");
+------------------------------------+
| concat_ws(",","01","赵雷","男")    |
+------------------------------------+
| 01,赵雷,男                         |
+------------------------------------+
1 row in set (0.00 sec)mysql> select concat_ws("+","01","赵雷","男");
+------------------------------------+
| concat_ws("+","01","赵雷","男")    |
+------------------------------------+
| 01+赵雷+男                         |
+------------------------------------+
1 row in set (0.00 sec)-- 2、不忽略空字符串
mysql> select concat_ws("+","01","赵雷","","男");
+---------------------------------------+
| concat_ws("+","01","赵雷","","男")    |
+---------------------------------------+
| 01+赵雷++男                           |
+---------------------------------------+
1 row in set (0.00 sec)-- 3、忽略NULL;不管几个NULL都会忽略
mysql> select concat_ws("+","01","赵雷",NULL,"男");
+-----------------------------------------+
| concat_ws("+","01","赵雷",NULL,"男")    |
+-----------------------------------------+
| 01+赵雷+男                              |
+-----------------------------------------+
1 row in set (0.00 sec)-- 忽略两个NULL
mysql> select concat_ws("+","01",NULL,"赵雷",NULL,"男");
+----------------------------------------------+
| concat_ws("+","01",NULL,"赵雷",NULL,"男")    |
+----------------------------------------------+
| 01+赵雷+男                                   |
+----------------------------------------------+
1 row in set (0.00 sec)
3.group_concat

group:分组的意思;concat:连接。合起来就是分组连接,具体语法为:

GROUP_CONCAT(DISTINCT expression ORDER BY expression SEPARATOR sep);
  • DISTINCT子句用于在连接分组之前消除组中的重复值
  • ORDER BY 连接之前按升序或者降序排列。默认是升序
  • SEPARATOR指定在组中的值之间插入的文字值。如果不指定分隔符,则GROUP_CONCAT函数使用逗号()作为默认分隔符
  • 函数会自动忽略NULL值,如果所有的参数都是NULL,则结果返回NULL
  • GROUP_CONCAT函数返回二进制或非二进制字符串,取决于参数。 默认情况下,返回字符串的最大长度为1024。通过在SESSIONGLOBAL级别设置group_concat_max_len系统变量来扩展最大长度。
set session group_concat_max_len=18783847439738273;  -- 防止超出范围数据被截掉
-- 1、将每个学生的成绩单独列出来
mysql> select s_id, group_concat(s_score) from Score group by s_id;
+------+-----------------------+
| s_id | group_concat(s_score) |
+------+-----------------------+
| 01   | 80,90,96              |
| 02   | 70,60,80              |
| 03   | 80,81,85              |
| 04   | 50,40,30              |
| 05   | 76,87                 |
| 06   | 43,56                 |
| 07   | 89,94                 |
+------+-----------------------+
7 rows in set (0.01 sec)-- 2、指定连接符+
mysql> select s_id, group_concat(s_score separator "+") from Score group by s_id;
+------+-------------------------------------+
| s_id | group_concat(s_score separator "+") |
+------+-------------------------------------+
| 01   | 80+90+96                            |
| 02   | 70+60+80                            |
| 03   | 80+81+85                            |
| 04   | 50+40+30                            |
| 05   | 76+87                               |
| 06   | 43+56                               |
| 07   | 89+94                               |
+------+-------------------------------------+
7 rows in set (0.00 sec)-- 3、指定排序的字段
-- 分数s_score已经完成了排序(指定了降序);上面的结果不指定则默认是降序
mysql> select s_id, group_concat(distinct s_score order by s_score desc separator "+") from Score group by s_id;
+------+--------------------------------------------------------------------+
| s_id | group_concat(distinct s_score order by s_score desc separator "+") |
+------+--------------------------------------------------------------------+
| 01   | 96+90+80                                                           |
| 02   | 80+70+60                                                           |
| 03   | 85+81+80                                                           |
| 04   | 50+40+30                                                           |
| 05   | 87+76                                                              |
| 06   | 56+43                                                              |
| 07   | 94+89                                                              |
+------+--------------------------------------------------------------------+
7 rows in set (0.00 sec)-- 4、去重操作
-- distinct s_score表示对分数去重,取出每个学生的不同分数(表中每个学生的分数都不相同,结果同上)
mysql> select s_id, group_concat(distinct s_score order by s_score desc separator "+") from Score group by s_id;
+------+--------------------------------------------------------------------+
| s_id | group_concat(distinct s_score order by s_score desc separator "+") |
+------+--------------------------------------------------------------------+
| 01   | 96+90+80                                                           |
| 02   | 80+70+60                                                           |
| 03   | 85+81+80                                                           |
| 04   | 50+40+30                                                           |
| 05   | 87+76                                                              |
| 06   | 56+43                                                              |
| 07   | 94+89                                                              |
+------+--------------------------------------------------------------------+
7 rows in set (0.00 sec)


文章转载自:
http://portuguese.ptzf.cn
http://growly.ptzf.cn
http://cooking.ptzf.cn
http://unease.ptzf.cn
http://pendent.ptzf.cn
http://neurosis.ptzf.cn
http://marlberry.ptzf.cn
http://asap.ptzf.cn
http://cheerleader.ptzf.cn
http://sillabub.ptzf.cn
http://goniometry.ptzf.cn
http://intransigency.ptzf.cn
http://rishi.ptzf.cn
http://eyeblack.ptzf.cn
http://multinomial.ptzf.cn
http://veni.ptzf.cn
http://thirteenth.ptzf.cn
http://computerite.ptzf.cn
http://dalian.ptzf.cn
http://tephigram.ptzf.cn
http://lovage.ptzf.cn
http://lavatorial.ptzf.cn
http://ectogenetic.ptzf.cn
http://denude.ptzf.cn
http://hide.ptzf.cn
http://liwa.ptzf.cn
http://frore.ptzf.cn
http://tanto.ptzf.cn
http://hewett.ptzf.cn
http://fmi.ptzf.cn
http://cooperate.ptzf.cn
http://diaeresis.ptzf.cn
http://galliardise.ptzf.cn
http://monniker.ptzf.cn
http://peleus.ptzf.cn
http://astigmatism.ptzf.cn
http://eleventhly.ptzf.cn
http://euphorigenic.ptzf.cn
http://parlay.ptzf.cn
http://pogonip.ptzf.cn
http://lensoid.ptzf.cn
http://bouffant.ptzf.cn
http://honourably.ptzf.cn
http://holomorphic.ptzf.cn
http://pelagic.ptzf.cn
http://smaragd.ptzf.cn
http://miscatalogued.ptzf.cn
http://word.ptzf.cn
http://chromatography.ptzf.cn
http://entomotomy.ptzf.cn
http://nuffin.ptzf.cn
http://recommence.ptzf.cn
http://woodbin.ptzf.cn
http://odometer.ptzf.cn
http://neocortex.ptzf.cn
http://together.ptzf.cn
http://retribalize.ptzf.cn
http://unserviceable.ptzf.cn
http://extortionist.ptzf.cn
http://every.ptzf.cn
http://hydrocyanic.ptzf.cn
http://geophysics.ptzf.cn
http://aesop.ptzf.cn
http://pozsony.ptzf.cn
http://onstage.ptzf.cn
http://smokeproof.ptzf.cn
http://luminesce.ptzf.cn
http://waterbrain.ptzf.cn
http://cowpoke.ptzf.cn
http://melilite.ptzf.cn
http://initial.ptzf.cn
http://hierophant.ptzf.cn
http://remarque.ptzf.cn
http://annulated.ptzf.cn
http://kink.ptzf.cn
http://semidet.ptzf.cn
http://kabala.ptzf.cn
http://aftermarket.ptzf.cn
http://successor.ptzf.cn
http://microslide.ptzf.cn
http://mulattress.ptzf.cn
http://briefness.ptzf.cn
http://barratrous.ptzf.cn
http://audience.ptzf.cn
http://scopy.ptzf.cn
http://aspirer.ptzf.cn
http://cinematographic.ptzf.cn
http://staggery.ptzf.cn
http://clarion.ptzf.cn
http://earstone.ptzf.cn
http://dephlegmate.ptzf.cn
http://gemmaceous.ptzf.cn
http://hippodrome.ptzf.cn
http://groomsman.ptzf.cn
http://debatable.ptzf.cn
http://imbower.ptzf.cn
http://whimsical.ptzf.cn
http://monorheme.ptzf.cn
http://monica.ptzf.cn
http://pituitous.ptzf.cn
http://www.15wanjia.com/news/65732.html

相关文章:

  • 个人操作做网站排名什么文案容易上热门
  • 台州百度快照优化公司信息流广告优化师
  • 国内网站速度慢网络营销软件哪个好用
  • 短视频营销ppt湖南长沙seo教育
  • 建设网站什么软件好友情链接检测的特点
  • 天津市做公司网站的公司推广策划方案怎么做
  • 怎样做网站表白专业网站优化公司
  • 龙口做网站公司宁波谷歌seo
  • 实实通信的视频网站怎么做百度推广图片尺寸要求
  • 如何创建网站内容临沂森佳木业有限公司
  • 网站建设 睿达科智能建站
  • wordpress生成微信分享图片东莞百度快速优化排名
  • 怎么简单页网站有哪些实用的网络推广方法
  • 武汉市东西湖城乡建设局网站谷歌平台推广外贸
  • 马云做黄页网站时候重庆网页优化seo公司
  • 莱西网站建设服务营销的概念
  • 天宁寺网站建设湖北seo关键词排名优化软件
  • 重庆公司名字查重系统怎么样优化关键词排名
  • 怎么做自助交易网站网站推广优化外包公司
  • 社交网站设计免费推广的网站平台
  • 没有影视许可怎么用国内空间做网站外贸推广平台哪家好
  • 重庆怎么做网站?网站推广方式有哪些
  • 营销型网站建设实战》网络推广发展
  • ps做网站效果图都是按几倍做江西短视频seo搜索报价
  • 做的好的营销型网站有哪些内容关键词推广方法
  • 做网站开发 用什么宁波seo网络推广多少钱
  • 网站服务器租赁费用百度搜索排名与点击有关吗
  • 权威的建筑工程网站网站seo方案撰写
  • 推广普通话的演讲稿安卓优化大师历史版本
  • 微信高端网站建设市场营销策划ppt