From: | James Olin Oden <joden(at)lee(dot)k12(dot)nc(dot)us> |
---|---|
To: | Doug Smith <doug(at)the-bridge(dot)net>, "pgsql-general(at)postgreSQL(dot)org" <pgsql-general(at)postgreSQL(dot)org> |
Subject: | Re: |
Date: | 1998-10-19 14:41:46 |
Message-ID: | 81Oct18.093330edt.35713@gateway.lee.k12.nc.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | 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
From | Date | Subject | |
---|---|---|---|
Next Message | Juan Carlos Castro y Castro | 1998-10-19 14:42:59 | Access & pgsql |
Previous Message | Oleg Broytmann | 1998-10-19 14:10:47 | Re: your mail |