CREATE TABLE `shoufei` ( `id` int(11) NOT NULL AUTO_INCREMENT, `shijian` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `xiangmu` varchar(20) NOT NULL, `jiage` float NOT NULL, `shuliang` int(11) NOT NULL, `jine` float DEFAULT NULL, PRIMARY KEY (`id`)) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8
SELECT GROUP_CONCAT(xiangmu) FROM shoufei;
SELECT GROUP_CONCAT(DISTINCT shuliang) FROM shoufei;
SELECT GROUP_CONCAT(xiangmu SEPARATOR ‘-‘) FROM shoufei;
SELECT GROUP_CONCAT(xiangmu ORDER BY xiangmu ASC SEPARATOR ‘-‘) FROM shoufei;
本文转自:https://jingyan.baidu.com/album/29697b91478e91ab20de3c9d.html?picindex=1
原文:https://www.cnblogs.com/nizuimeiabc1/p/12173743.html