Re: [SQL] Concatenation in selects

Поиск
Список
Период
Сортировка
От James Olin Oden
Тема Re: [SQL] Concatenation in selects
Дата
Msg-id 81Sep2.090702edt.35713@gateway.lee.k12.nc.us
обсуждение исходный текст
Ответ на Concatenation in selects  (James Olin Oden <joden@lee.k12.nc.us>)
Ответы Re: [SQL] Concatenation in selects  (Leslie Mikesell <les@Mcs.Net>)
Список pgsql-sql


> I know it can be done, but I cannot seem to figure out how to output to
> fields concatenated together in a select.  For instance, I have a table
> with first_name and last_name as fields (among others).  I would like
> display first_name and last_name as one field.  I want to do something
> like:
>
>    name=first_name + " " + last_name
>
> but of course within an SQL select statement.  Thanks...james

Sorry, I finally found it in the hackers mailing list.  The answer is:

  select textcat(textcat(first_name, ' '),last_name) from users;

I just couldn't seem to find that documented, I am sure it is though.
Thanks...james



В списке pgsql-sql по дате отправления:

Предыдущее
От: James Olin Oden
Дата:
Сообщение: Concatenation in selects
Следующее
От: Sergei Barbarash
Дата:
Сообщение: indexing datetime