Re: Simple concatenation in select query

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Simple concatenation in select query
Дата
Msg-id 13672.965077557@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Simple concatenation in select query  ("Sandis" <sandis@mediaparks.lv>)
Список pgsql-sql
"Sandis" <sandis@mediaparks.lv> writes:
> Ok, i got it, after all! It took > 30 min to write this query.  :(
> SELECT textcat(textcat(first_name,text ' '),last_name) from table;

It's a lot easier if you use the SQL-standard concatenation operator:

regression=# select 'foo' || 'bar';?column?
----------foobar
(1 row)

textcat() just exists to implement the operator, which is why it's
not documented separately.

Dunno why you'd need to specify the type of the constant explicitly
in this context --- there is only one textcat function, so the system
ought to be able to figure it out.
        regards, tom lane


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

Предыдущее
От: Henry Lafleur
Дата:
Сообщение: RE: Simple concatenation in select query
Следующее
От: Timothy Covell
Дата:
Сообщение: What's ETA for read/write Views?