tags:

views:

33

answers:

1

I am trying to use CONCAT with SQL to concatenate 3 fields, and get the following error:

Incorrect parameters in the call to native function 'CONCAT'

The query is as follows

SELECT CONCAT(guests.lastname,', ',guests.firstname', ',guests.passport) AS display 
  FROM guests 
 WHERE guests.uuid = '1'

How do you concatenate more than 2 fields in SQL?

+5  A: 

You must put commas between all the arguments.

Change:

 SELECT CONCAT(guests.lastname,', ',guests.firstname', ',guests.passport)

to:

 SELECT CONCAT(guests.lastname,', ',guests.firstname,', ',guests.passport) 
                                                    ^
Mark Byers
+1: You were first
OMG Ponies