标签:limit ble code sele name sql语句 utf8 incr 标记
1.有张表,用来标记某些分子的属性信息。如下表:
CREATE TABLE `t` (
`No` int(11) NOT NULL COMMENT ‘编号‘,
`Name` varchar(20) DEFAULT NULL COMMENT ‘名称‘,
`Location` varchar(20) DEFAULT NULL COMMENT ‘位置‘,
`Id` int(11) NOT NULL AUTO_INCREMENT,
PRIMARY KEY (`Id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
插入一批数据。如下图:
2.想要的效果,如下图,即每个分子的属性信息以/间隔,分子之间以逗号间隔。作为jqGrid的列头Header。
2/分子1/L1,3/分子2/L2,4/分子3/L3,5/分子4/L4,6/分子5/L5,7/分子6/L6,8/分子7/L7,9/分子8/L8,10/分子9/L9,11/分子10/L10
3.sql语句如下:
SELECT
CONCAT(
group_concat(
temp.temp_column SEPARATOR ‘,‘
)
) AS temp_column
FROM
(
SELECT
concat(
no,
‘/‘,
name,
‘/‘,
location
) AS temp_column
FROM
t
LIMIT 0,
10
) AS temp
标签:limit ble code sele name sql语句 utf8 incr 标记
原文地址:https://www.cnblogs.com/jeff151013/p/11159208.html