mysql拼接多条查询结果并且加序列
SELECT GROUP_CONCAT(a.DESCRIPTION SEPARATOR '\n')
FROM (SELECT (@rowNum:=0) AS rowNo,CONCAT('公司内部来文:','\n',
GROUP_CONCAT((@rowNum:=@rowNum+1),DESCRIPTION,CHAR(13),'\n' SEPARATOR '\n')) DESCRIPTION
FROM pj_pro_receive_file_t
WHERE receive_file_type = (
SELECT lookup_code_id FROM fnd_lookup_code_t WHERE lookup_type = 'RECEIVE_FILE' AND lookup_code = 'NBLW')
FROM (SELECT (@rowNum:=0) AS rowNo,CONCAT('公司内部来文:','\n',
GROUP_CONCAT((@rowNum:=@rowNum+1),DESCRIPTION,CHAR(13),'\n' SEPARATOR '\n')) DESCRIPTION
FROM pj_pro_receive_file_t
WHERE receive_file_type = (
SELECT lookup_code_id FROM fnd_lookup_code_t WHERE lookup_type = 'RECEIVE_FILE' AND lookup_code = 'NBLW')
AND project_id = 173 AND receive_status = '1' AND DATE_FORMAT(creation_date, '%Y-%m-%d') = DATE_FORMAT(NOW(), '%Y-%m-%d')) a;
java需要转译@rowNum\\:=0