Results 1 to 3 of 3
  1. #1
    Join Date
    May 2003
    Posts
    34

    Unanswered: How to create such a view

    I have 2 columns in a table which comprise the column names & data for the view

    col_name value refid
    ---------- ------ --------
    oid 111 1
    custid 231 1
    typecode 344 1
    slabel sss 1
    name zzz 1
    oid 121 2
    custid 211 2
    typecode 334 2
    slabel sww 2
    name zut 2


    i want to create a view

    where the column names are
    (oid,custid,typecode,slabel,name)


    the corresponding values 1st row (111,231,344,'sss','zzz');
    the corresponding values 2nd row (121,211,334,'sww','zut');



    How to acheiv this

    Rgrds

  2. #2
    Join Date
    Sep 2003
    Posts
    156

    Re: How to create such a view

    Originally posted by zulu99
    I have 2 columns in a table which comprise the column names & data for the view

    col_name value refid
    ---------- ------ --------
    oid 111 1
    custid 231 1
    typecode 344 1
    slabel sss 1
    name zzz 1
    oid 121 2
    custid 211 2
    typecode 334 2
    slabel sww 2
    name zut 2


    i want to create a view

    where the column names are
    (oid,custid,typecode,slabel,name)


    the corresponding values 1st row (111,231,344,'sss','zzz');
    the corresponding values 2nd row (121,211,334,'sww','zut');



    How to acheiv this

    Rgrds
    Your question is unclear, what are original tables, is what you put down the table, or the result that you would like?

    create view view_name as
    select oid,custid,typecode,slabel,name
    from table_name...

    obviously you are dealing with tables - so you would then have to link them, as for a normal select from multiple tables i.e -
    where a.column = b.column
    and b.column = c.column
    rgs,

    Ghostman

  3. #3
    Join Date
    May 2003
    Posts
    34

    regarding the view creation

    Hi

    Sorry for not framing the question correctly. i have a table with 3 columns & the accompanying data

    col_name value refid
    ---------- ------ --------
    oid 111 1
    custid 231 1
    typecode 344 1
    slabel sss 1
    name zzz 1
    oid 121 2
    custid 211 2
    typecode 334 2
    slabel sww 2
    name zut 2


    the col_name column is the name of all the columns for the view & the value column comprises of data for those columns & the refid represents 1 dataset

    Now i want to have the column names for my view as the names in col_name column & values as in the value column

    like this
    oid custid typecode slabel name
    --- ------ ----------- -------- -------
    121 211 334 sww zut
    111 231 344 sss zzz


    Rgrds
    Zulu

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •