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

Thread: UnExpected results - ASAP

  1. #1
    Join Date
    Dec 1999
    Location
    Alpharetta, GA, US
    Posts
    192
    Hi Guys, i would like to share with you what is going on in one of my applications.
    I got the partition table, each partition has got one month data. i ran some queries on one of the partition, i got the results back with some values. but they were not addind up the total sum.
    Here is my table and querys. I would be appriciate your openion.

    sql> dec Jun2001
    opc varchar2(11),
    dpc varchar2(11),
    mess_time date,
    mess_num number(5),
    mcount number(5),
    p_id number(3)

    Query:

    select sum(mcount)
    from jun2001
    where to_char(mess_time, 'YYMMDDHH') = '01062910'
    and dpc = '111.151.101'
    or opc = '111.151.101'; --- BAD RESULTS

    select sum(mcount)
    from jun2001
    where to_char(mess_time, 'YYMMDDHH') = '01062910'
    and dpc = '111.151.101';


    Thanks

  2. #2
    Join Date
    Nov 2000
    Location
    greenwich.ct.us
    Posts
    9,092
    You most likely have a logic problem. I would bet you are looking for:
    select sum(mcount)
    from jun2001
    where to_char(mess_time, 'YYMMDDHH') = '01062910'
    and (dpc = '111.151.101'
    or opc = '111.151.101');
    Jeff Hunter
    marist89@yahoo.com
    http://marist89.blogspot.com/
    Get Firefox!
    "I pledge to stop eating sharks fin soup and will not do so under any circumstances."

  3. #3
    Join Date
    Nov 2000
    Posts
    245

    can you give us more information.

    what is total sum
    what your mean bad result

    so far, I only can "guess", you have null value in opc and dpc

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