: [GENERAL] Conactenating text with null values
On Fri, Nov 05, 2004 at 12:51:11PM +0100, Csaba Nagy wrote:
> [snip]
> > SELECT TRIM(TRIM(TRIM(COALESCE(s_house,'') || ' ' ||
> > COALESCE(s_post_dir,'')) || ' ' || COALESCE(s_street ,''
Cool, this goes to my "util" mail folder :-)
[snip]
> But it's still too cumbersome. How about creating a new operator? With
> the example below the query would simply be
>
> SELECT s_host ||~ s_post_dir ||~ s_street ||~ s_suffix
> FROM parcels
> WHERE s_pin = '1201703303520';
>
> alvherre=
On Fri, Nov 05, 2004 at 12:51:11PM +0100, Csaba Nagy wrote:
> [snip]
> > SELECT TRIM(TRIM(TRIM(COALESCE(s_house,'') || ' ' ||
> > COALESCE(s_post_dir,'')) || ' ' || COALESCE(s_street ,'')) || ' ' ||
> > COALESCE(s_suffix,'')) FROM parcels WHERE s_pin = '1201703303520';
> >
> > The TRIMs are to rem
[snip]
> SELECT TRIM(TRIM(TRIM(COALESCE(s_house,'') || ' ' ||
> COALESCE(s_post_dir,'')) || ' ' || COALESCE(s_street ,'')) || ' ' ||
> COALESCE(s_suffix,'')) FROM parcels WHERE s_pin = '1201703303520';
>
> The TRIMs are to remove surplus spaces from inside the result string.
Avoiding the inner tri
SELECT COALESCE(s_house,'') || COALESCE(s_post_dir,'') || COALESCE(s_street,'') ||
COALESCE(s_suffix,'') FROM parcels WHERE s_pin = '1201703303520';
Gregory S. Williamson schrieb:
This is postgres 7.4 on a linux box ...
I have driven myself to distraction trying to what ought to be easy.
I have a
[mailto:[EMAIL PROTECTED]
Sent: Fri 11/5/2004 2:15 AM
To: Gregory S. Williamson
Cc: [EMAIL PROTECTED]
Subject:Re: [GENERAL] Conactenating text with null values
On Fri, 2004-11-05 at 09:25, Gregory S. Williamson wrote:
> This is postgres 7.4 on a linux box ...
>
> I have driven
On Fri, 2004-11-05 at 09:25, Gregory S. Williamson wrote:
> This is postgres 7.4 on a linux box ...
>
> I have driven myself to distraction trying to what ought to be easy.
>
> I have a table with house number, street direction, street name and
> street suffix as 4 columns. I want to paste them t
On Fri, Nov 05, 2004 at 01:25:07AM -0800, Gregory S. Williamson wrote:
> SELECT s_house,s_post_dir,s_street,s_suffix FROM parcels WHERE s_pin =
> '1201703303520';
> s_house | s_post_dir |s_street| s_suffix
> -+++--
> 34643 || FIG
Gregory S. Williamson wrote:
SELECT s_house,s_post_dir,s_street,s_suffix FROM parcels WHERE s_pin
= '1201703303520'; s_house | s_post_dir |s_street| s_suffix
-+++-- 34643 |
| FIG TREE WOODS |
So to get "34643 FIG TREE WOODS" what do I do ?
SEL
This is postgres 7.4 on a linux box ...
I have driven myself to distraction trying to what ought to be easy.
I have a table with house number, street direction, street name and street suffix as 4
columns. I want to paste them together as one text string for use by another
application.
SELECT s
10 matches
Mail list logo