Re: Using right() in a view - Mailing list pgsql-general

From Bosco Rama
Subject Re: Using right() in a view
Date
Msg-id 4DDA8D42.4000003@boscorama.com
Whole thread Raw
In response to Using right() in a view  (Chrishelring <christianhelring@gmail.com>)
List pgsql-general
Chrishelring wrote:
>
> CREATE OR REPLACE VIEW test AS
> SELECT
>   right(cast('000' as text) || cast(road_number as text), 4) AS GEO_ADRESSE
>
> FROM rk_ois.bbrbygning
> WHERE ejerlav <> 0
>
> to ensure that the road_number would be a fixed size (four digitis).
> Unfortunately this doesn't work.

Try using:
   select to_char(road_number, 'FM0000') as GEO_ADRESSE

HTH

Bosco.

pgsql-general by date:

Previous
From: Chitra
Date:
Subject: Postgre Client only Install on Linux- 8.4.7
Next
From: Bosco Rama
Date:
Subject: Re: Postgres 8.3.5 - ECPG and the use of descriptors and cursors in multi-threaded programs