select multiple rows into one row pt 2
DBAsupport.com Forums - Powered by vBulletin
Results 1 to 2 of 2

Thread: select multiple rows into one row pt 2

  1. #1
    Join Date
    Dec 2003
    Posts
    90

    select multiple rows into one row pt 2

    sorry to post a new thread but something happened to the other one and i can't reply to it.

    On DaPi's advice i used a query like this...

    select id,
    cast ( multiset( select user_id
    from caw_tabsaccess
    where caw_tabsaccess.tab_id = caw_tabs.id and caw_tabsaccess.user_id IS NOT null
    group by user_id ) as ONEDNUMBERARRAY ) USER_ID
    from caw_tabs;

    to get multiple rows into one.

    the problem is it returns results like this

    ID USER_ID
    -- -------
    1
    45
    56


    so my problem is how do i get the actual results from the in USER_ID column? ONEDNUMBERARRAY is table of numbers.
  2. #2
    Join Date
    Dec 2003
    Posts
    90
    ok i get the same problem in this thread, don't enter anything in angle bracets apparently.

    when i run the query i get

    ID USER_ID
    -- -----------
    1 ONEDNUMBERARRAY()
    2 ONEDNUMBERARRAY()
    3 ONEDNUMBERARRAY()
    4 ONEDNUMBERARRAY()
    5 ONEDNUMBERARRAY()
    .
    .
    .

    So how do i get the value back from ONEDNUMBERARRAY()

  3. Posting Permissions

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



Click Here to Expand Forum to Full Width