Re:

Поиск
Список
Период
Сортировка
От James Olin Oden
Тема Re:
Дата
Msg-id 81Oct18.093330edt.35713@gateway.lee.k12.nc.us
обсуждение исходный текст
Ответ на ...  ("Doug Smith" <doug@the-bridge.net>)
Список pgsql-general
 Why is that I can only cat two variables in a select statement.ex. select lastname||' '||firstname||' '||address
Delivers an parseing error at "||". When tryingex. select lastnamae||firstnameIt works fine.What's up?

Doug...

 
Hi Doug,

The || operator operates more like a functiion than an operator.  What I mean by that is that, as you have surmised, it takes two and only two arguments.  This does not mean that you cannot concatenate more than two strings...you just need to use parenthesis in the proper way.  Your query would become:

   select ((((lastname||' ')||firstname)||' ')||address

Of course you would need the rest of your query (I assume that was just the half that was giving you trouble).

Hope this helps...james
 
 

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

Предыдущее
От: Oleg Broytmann
Дата:
Сообщение: Re: your mail
Следующее
От: Anton de Wet
Дата:
Сообщение: Re: your mail