由于项目有需求,要将很多属性合并成一个属性返回给前端,为了减少数据库请求次数和数据量,所以就使用了concat函数
concat系列函数,常用的有三个
concat(str1, str2, ...):就是将传入的所有字符创依次拼接起来,只要其中有一个属性为null,则返回null


concat_ws(separator, str1, str2, ...):第一个参数为分隔符,后面为需要拼接的字符串,碰到参数中的null,默认忽略,这个很好用


由于项目有需求,要将很多属性合并成一个属性返回给前端,为了减少数据库请求次数和数据量,所以就使用了concat函数
concat系列函数,常用的有三个
本文标题:concat函数
本文链接:https://www.haomeiwen.com/subject/tytphhtx.html
网友评论