我想使用MySQL
在select语句中加入一些属性SELECT
(Cast(n_socio As varchar), ' - ', nombre, ' ', apellidos) As DisplayItem,
N_socio
FROM
usuarios
ORDER BY
n_socio
答案 0 :(得分:1)
使用MySQL CONCAT函数,如
SELECT CONCAT((Cast(n_socio AS varchar),' - ',nombre ,' ',apellidos)) AS DisplayItem,
N_socio
FROM usuarios
ORDER BY n_socio
答案 1 :(得分:1)
您缺少CONCAT
功能。
SELECT
CONCAT(Cast(n_socio As varchar), ' - ', nombre, ' ', apellidos) As DisplayItem,
N_socio
FROM
usuarios
ORDER BY
n_socio