Reputation: 23
I need to concat two columns firstname
and lastname
as name in a crosstab select, example:
select * from crosstab('SELECT concat(u.firstname," ",u.lastname)as name
But I get this error:
column « » doesn't exist.
How can I do it?
Upvotes: 2
Views: 7695
Reputation: 1174
Try this:
select * from crosstab('SELECT concat(u.firstname,'' '',u.lastname) as name')
I added a missing "close quote" at the end of your crosstab string, and I doubled-up the single quotes to escape them within that string.
Upvotes: 1
Reputation: 5621
Replace double quote by simple quote like:
SELECT concat(u.firstname,' ',u.lastname)
Upvotes: 2