I'm using Postgres 9.5. I want to write an order by expression for a series of concatenated strings, but I'm not sure if that's possible or how to do it. I have cobbled together the below
myproject=> SELECT "my_objects".*
FROM "my_objects"
left join addresses on my_objects.address_id = addresses.id
WHERE (my_objects.name ILIKE '%my_object%'
AND EXISTS (SELECT *
FROM my_object_times
WHERE my_object_times.my_object_id = my_objects.id))
order by lower(addresses.city) || "," || addresses.state_id;
ERROR: column "," does not exist
LINE 1: ...id = my_objects.id)) order by lower(addresses.city) || "," || add...
But as you can see there is an error complaining about syntax. Is what I'm tryihng to do possible and if so how do I write an order by clause based on a concatenation of columns?