Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CREATE OR REPLACE VIEW metabib.rec_descriptor AS
- SELECT id
- , id AS record
- , item_type
- , item_form
- , bib_level
- , control_type
- , char_encoding
- , enc_level
- , audience
- , lit_form
- , type_mat
- , cat_form
- , pub_status
- , item_lang
- , vr_format
- , date1
- , date2
- FROM crosstab(
- 'SELECT v.source AS id,
- m.attr,
- m.value
- FROM metabib.full_attr_id_map m
- JOIN metabib.record_attr_vector_list v ON m.id = ANY (v.vlist)
- ORDER BY v.source'
- ,$$VALUES ('item_type'), ('item_form'), ('bib_level'), ('control_type'), ('char_encoding'), ('enc_level'), ('audience'), ('lit_form'), ('type_mat'), ('cat_form'), ('pub_status'), ('item_lang'), ('vr_format'), ('date1'), ('date2')$$
- ) AS ct (
- id bigint
- , item_type text
- , item_form text
- , bib_level text
- , control_type text
- , char_encoding text
- , enc_level text
- , audience text
- , lit_form text
- , type_mat text
- , cat_form text
- , pub_status text
- , item_lang text
- , vr_format text
- , date1 text
- , date2 text
- );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement