Browse Source

Definition view xcube_wohnort_staat

xcube0.1
Marlies Winterstein 2 years ago
parent
commit
4b7a64d33c
  1. 20
      src-modules/module/xcube/schluesseltabellen/create_views.sql

20
src-modules/module/xcube/schluesseltabellen/create_views.sql

@ -0,0 +1,20 @@
drop view if exists xcube_wohnort_staat;
create view xcube_wohnort_staat(
druck,
apnr,
parent) as
select 'Deutschland'::varchar(255) as druck ,
'0'::char(10) as apnr,
null as parent
from xdummy
union select druck,
apnr,
'0' as parent
from cifx where key=8
union select druck,
'' || val(astat) as apnr ,
bund_apnr as parent
from cifx where key=11
union select 'Ausland' druck , '1' apnr, null as parent from xdummy
union select druck,apnr,'1' from cifx where key=747 and parent is not null
union select druck, '' || astat::integer, bund_apnr from cifx where key=12 and apnr != 'D'
Loading…
Cancel
Save