DBAsupport.com Forums - Powered by vBulletin
Results 1 to 2 of 2

Thread: difference b/w these two sql statements

  1. #1
    Join Date
    Aug 2001
    Location
    chennai,bangalore
    Posts
    840
    Hi friends.
    can you please explain me the difference in logic for these two statements,because i feel its the same, but i am getting different result sets...please explain me the difference....

    statement 1
    select 'TrackOnlyUsers', count(t1.company_id), nvl(t3.type,9)
    from noah_user_plan t1, csr_routing_stats t3
    where t1.plan_component_id = 400
    and sysdate between t1.activation_date and t1.expiration_date
    and t1.company_id not in (select t2.company_id from noah_user_plan t2
    where t2.company_id = t1.company_id
    and sysdate between t2.activation_date and t2.expiration_date
    and t2.plan_component_id <> 400)

    and t1.company_id = t3.company_id(+)
    and t1.company_id not in (
    select company_id from company_suspend where
    suspend_status='SP' and deleted='N'
    )
    group by t3.type;

    statement 2
    select 'TrackOnlyUsers', count(t1.company_id), nvl(t3.type,9)
    from noah_user_plan t1, csr_routing_stats t3
    where t1.plan_component_id = 400
    and sysdate between t1.activation_date and t1.expiration_date
    and t1.company_id = t3.company_id(+)
    and t1.company_id not in (
    select company_id from company_suspend where
    suspend_status='SP' and deleted='N'
    )
    group by t3.type;


    please help me...

    regards
    anandkl
    anandkl

  2. #2
    Join Date
    May 2002
    Posts
    219
    Without knowing the table structures and relationship between the entities? I think more detail is in order...

    Accomplishing the impossible means only that the boss will add it to your regular duties.
    Doug Larson
    yodaDBA@hotmail.com

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