SQL Server Performance

Query this data sql

Discussion in 'SQL Server 2005 T-SQL Performance Tuning' started by iwahyudi, Feb 14, 2013.

  1. iwahyudi New Member



    Hai..
    Sorry Need Help :)

    How to join this query into one table ..query like this :

    select sum(ots_principal) as tot_ar from WOM_AGING.XAGING_MONTHLY where periode = 201212

    select count(order_no) as tot_count from WOM_AGING.XAGING_MONTHLY where periode = 201212

    select distinct b.cabang_data_audit as cabang,
    (case
    when a.dpd = 0 then '1 DPD 0'
    when a.dpd <= 30 then '2 DPD 01-30'
    when a.dpd <= 60 then '3 DPD 31-60'
    when a.dpd <= 90 then '4 DPD 61-90'
    when a.dpd <= 120 then '5 DPD 91-120'
    when a.dpd <= 150 then '6 DPD 121-150'
    when a.dpd <= 180 then '7 DPD 151-180'
    when a.dpd > 180 then '8 DPD 180 up'
    else '9 tdk ada data '
    end )bucket

    from WOM_AGING.XAGING_MONTHLY a,WOM_AUDIT.SWI_CABANG_MAP_AUDIT b
    where a.cab_id =b.cab_id and a.periode= 201212
    group by cabang_data_audit



    Ps: for Field Cabang and Buket already succes but Tot_ar an tot_count not yet because always error message


    The result must like this :

    Cabang Buket Tot_Ar Tot_Count


    Best Rgs
    Indra

    Indra Wahyudi

Share This Page