cannot process using witth data
DBAsupport.com Forums - Powered by vBulletin
Results 1 to 2 of 2

Thread: cannot process using witth data

  1. #1
    Join Date
    Mar 2010
    Posts
    6

    cannot process using witth data

    Need to use same query to decode and then use data based on the lower between clause to show

    WITH DATA AS (select tb.address_id,DECODE(tb.month,
    '1', '01',
    '2', '02',
    '3', '03',
    '4', '04',
    '5', '05',
    '6', '06',
    '7', '07',
    '8', '08',
    '9', '09',
    '10','10',
    '11','11',
    '12','12'
    ) month, tbc.year from t_table tb
    )
    SELECT DATA.*,
    (select tt.address_id,tt.month,tt.year -- should show the records which exist
    from t_table tt
    where
    to_date(data.month||data.year,'mmyyyy')
    -- from table tbc take this value
    between to_date('102009','mmyyyy') and
    to_date('112009','mmyyyy')
    )
    FROM DATA;

    Output should come from the inner query only where between condition works..

    so we should see only those addressids for 10-2009 to 11-2009.

  2. #2
    Join Date
    Sep 2002
    Location
    England
    Posts
    7,333
    and the problem is?

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