CONCAT in sql developer [duplicate]

邮差的信 提交于 2019-12-13 09:55:03

问题


it does not runing,please show me where I have a mistake?

SELECT CONCAT(FIRST_NAME,',',LAST_NAME) as full_name FROM EMPLOYEES;


回答1:


Use ANSI SQL's || instead to concat:

SELECT FIRST_NAME || ',' || LAST_NAME as full_name FROM EMPLOYEES;

(CONCAT() function takes two arguments only.)




回答2:


Concat only expects two Parameter, so you have to use nested concats:

SELECT CONCAT(CONCAT(FIRST_NAME,','), LAST_NAME) as full_name FROM EMPLOYEES;

For more informations see the Oracle documentation




回答3:


concat takes 2 arguments. Try using it twice, like:

SELECT CONCAT(CONCAT(FIRST_NAME,','), LAST_NAME) as full_name FROM EMPLOYEES;



回答4:


concat(String, String) is only use 2 parameters. If you want use ','

SELECT FIRST_NAME||','||LAST_NAME as full_name FROM EMPLOYEES


来源:https://stackoverflow.com/questions/52588029/concat-in-sql-developer

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!