Results 1 to 4 of 4

Thread: script problem

  1. #1
    Join Date
    Aug 2005
    Location
    Kuala Lumpur, MY
    Posts
    108

    Unanswered: script problem

    hie all i have a problem here

    this is my table contains
    reload_date, loyalty_id, origin_id, status, reload_amount

    what i need it

    reload_date, loyalty_id, sum of reloads_amount where origin_id <> 'CLP', sum of reloads_amount where status <> '0'
    and then need to group by loyalty_is and reload_date.

    i have been trying to do this but it doesnt turn out.. it returns, single-row sub query returns more than one row.. anyone can help me with the script...

    thanks

  2. #2
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    Maybe, if you show us your script. How could we guess what is wrong when we don't see it? Obviously, there is a subquery there, but ...

  3. #3
    Join Date
    Jul 2003
    Posts
    2,296
    What oracle version?
    - The_Duck
    you can lead someone to something but they will never learn anything ...

  4. #4
    Join Date
    Jun 2004
    Location
    Liverpool, NY USA
    Posts
    2,509
    select reload_date,
    loyalty_id,
    sum(decode(origin_id,'CLP',0,reloads_amount)) total_1,
    sum(decode(status,0,0,reloads_amount)) total_2
    from my_table
    group by reload_date,loyalty_id;
    Bill
    You do not need a parachute to skydive. You only need a parachute to skydive twice.

Posting Permissions

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