Results 1 to 3 of 3

Thread: SQL Help

  1. #1
    Join Date
    Feb 2005

    Unanswered: SQL Help

    Is there anyway to make this query more efficient. I've been told that it uses to much memory. Thanks

    Stage1 As(Select acc_no, sum(column1) as s1, sum(column2) as s2,
    sum(column3) as s3,...
    From Table1
    Where Date = '??/??/????'
    Group by acc_no),

    Stage2 As(Select * From Stage1
    Where s1 > 0 or s2 > 0 or s3 > 0 ...)

    Select count(*) from Stage2;

  2. #2
    Join Date
    Nov 2004


    if this query or similar queries are often executed, maybe ast automated summary tables would help
    Have a look in reference how to handle these
    Best Regards, Guy Przytula
    Best Regards, Guy Przytula
    DB2/ORA/SQL Services
    DB2 DBA & Advanced DBA Certified
    DB2 Dprop Certified

  3. #3
    Join Date
    Feb 2005
    Thanks, I'll have a look. What happens is that everytime I run that query the database goes down.

Posting Permissions

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