-3

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

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

enter image description here

Jens
  • 67,715
  • 15
  • 98
  • 113

4 Answers4

4

Use ANSI SQL's || instead to concat:

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

(CONCAT() function takes two arguments only.)

jarlh
  • 42,561
  • 8
  • 45
  • 63
4

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

Jens
  • 67,715
  • 15
  • 98
  • 113
3

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

SELECT CONCAT(CONCAT(FIRST_NAME,','), LAST_NAME) as full_name FROM EMPLOYEES;
apomene
  • 14,282
  • 9
  • 46
  • 72
2

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

SELECT FIRST_NAME||','||LAST_NAME as full_name FROM EMPLOYEES
develtype
  • 76
  • 5