1,mysql
concat('a','b','c')和concat_ws('a','b','c')的区别:前者如果有某个值为空,结果为空;后者如果有某个值为空,可以忽略这个控制
SELECT
concat_ws('',FORE_TWO,THIRD_POSITION,FOURTH_POSITION,FIFTH_POSITION) AS code
FROM
TABLE_A
WHERE
ID= #{id}
2,oracle
SELECT
FORE_TWO||THIRD_POSITION||FOURTH_POSITION||FIFTH_POSITION AS code
FROM
TABLE_A
WHERE
ID = #{id}