Results 1 to 8 of 8
  1. #1
    Join Date
    Feb 2009
    Posts
    47

    Unanswered: System Resource Exceeded....error

    what does this mean and how do I fix it. I am running mutiple queries on a large Dataset.
    Over 40K rows of data and than I was trying to run a Left join Query that takes required columns form the 16 sub queries and puts them together. But than this error showed up. So how do i fix it so i can run the Left join query and get my output.

  2. #2
    Join Date
    Sep 2002
    Location
    South Wales
    Posts
    580
    Windows Server 2003-8 / Terminal Services / SQL 2000 / Access 2003 / Office 2003-7 / Exchange 2003-7 / Blackberry Enterprise Server / AutoCAD / Lambert And Butler / Red Bull

  3. #3
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    16 sub-queries..?!
    This sounds needlessly complex...

    Care to share the SQL?
    George
    Home | Blog

  4. #4
    Join Date
    Feb 2009
    Posts
    47
    So since I have 16 columns to join what can i do. Will making Table queries help.

  5. #5
    Join Date
    Feb 2009
    Posts
    47

    16 columns were required

    I am running counts form a single main table.
    waht i am counting is INDEX, the number of times a particualr INDEX apperead
    in the list. The lists are seperated due to their size like
    Column 1--Column 2
    <=2 --- 2> And <=4
    So I have 16 columns like that in 16 different queries, since the WHERE criteria changes(<=2,>4. 5> and <=7 etc) and you can only have one WHERE statement in a query so I had to have 16 queries. But My final result is suppose to join the 16 columns form these sub queires.

  6. #6
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    Depending on the exact query and table strucutes it may be possible to re-write using only a couple of JOINS.

    This would be achieved using CASE expressions and aggregation (GROUP BY).

    If you want to persue this then post your current SQL
    George
    Home | Blog

  7. #7
    Join Date
    Sep 2002
    Location
    South Wales
    Posts
    580
    Can you not have various criteria in one SQL statement and use the GROUP BY clause?

    This sort of thing (Psudocode);
    CASE WHEN (first set of criteria is true) 'First Category' WHEN (second set of criteria is true) 'Second Category' ELSE 'Uncategorised' END as strCategory
    WHERE (first set of criteria) OR (second set of criteria) OR (...n set of criteria) GROUP BY CASE WHEN (first set of criteria is true) 'First Category' WHEN (second set of criteria is true) 'Second Category' ELSE 'Uncategorised' END as strCategory...

    Maybe post one of your SQL statements so we can have a look to see what you are trying to achieve...

    ...Beat me to it Georgev!...
    Windows Server 2003-8 / Terminal Services / SQL 2000 / Access 2003 / Office 2003-7 / Exchange 2003-7 / Blackberry Enterprise Server / AutoCAD / Lambert And Butler / Red Bull

  8. #8
    Join Date
    Feb 2009
    Posts
    47
    SELECT PSMM_NPhase.CONCAT, Count(PSMM_NPhase.NPHASE) AS 2_3 INTO SRHWND_1
    FROM PSMM_NPhase
    WHERE (((Abs(PSMM_NPhase.NPhase))>=2 And (Abs(PSMM_NPhase.NPhase))<3))
    GROUP BY PSMM_NPhase.CONCAT;



    I have 16 of these WHERE clause 2-3,3-4,5-7 and so on
    they have to give an output like the following Table.First row is column headings.

    INDEX--(0-2)--(2-3)--(3-4)--(4-5)--(5-7)--.....
    e.g
    (121-58)--(5)--(7)--(12)--( )--(38)--.......First row
    (161-38)--(1)--( )--(32)--(9 )--(71)--.......Second row

    number in () are counts first one is the INDEX and rest are counts of how many values for that particular INDEX were with in the parameter. Like "5" values within the range of 0-2 and "7" values were within the renage of 2-3

Posting Permissions

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