问题
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