Search Postgresql Archives

Using right() in a view

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi all,

please foregive me for this rather trivial question, but IÂve worked in it
for quite som time and could use som help now. :)

I have a table where it want to create a idkey using our municipality number
+ the road number + the housenumber.

The municipality and housenumber is in a fixed size, so they are okay. But
the road number differs from two digits up to four. I was then thinking
about doing something like this:

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. 

Any idea on how to solve this?

Christian

--
View this message in context: http://postgresql.1045698.n5.nabble.com/Using-right-in-a-view-tp4419141p4419141.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux