-3

Trying to concat 3 columns into one, but keep getting an error that I have an invalid number of arguments.

select concat("first_name", " ", "last_name", " ", "job_id")
from employees;
forpas
  • 160,666
  • 10
  • 38
  • 76
Nakura
  • 1
  • 1
  • `select concat(first_name, " ", last_name, " ", job_id) from employees;` try this! – ShivCK May 02 '19 at 16:37
  • @JoakimDanielson Yes its a very basic two line query. – Nakura May 02 '19 at 16:59
  • Don’t tag your question with the wrong database. This is oracle and concat in oracle only takes two parameters. – Joakim Danielson May 02 '19 at 17:01
  • `"first_name"`? `" "`? What are these? String literals or column names? It should be single quotes for string literals and double quotes for names. But my advice is to avoid quotes for names entirely. Just don't use any special characters or names that make them necessary. If `first_name` is a column name, then you don't need quotes, the name is valid in itself. – Thorsten Kettner May 02 '19 at 17:12

1 Answers1

0

ORA-00909 is an Oracle error, not Mysql.
In Oracle concat() takes only 2 arguments.
Use the || operator.

select first_name || ' ' || last_name || ' ' || job_id AS NewName from employees;
forpas
  • 160,666
  • 10
  • 38
  • 76