• sgmunson (7/10/2014)


    Have you looked at the query's execution plan? This would likely reveal the reason. Also, is there more than one record in the table with alias B for a given BOEKCODE value ? In that case you may be traversing a lot of records that aren't needed, as including the B table in the result set requires retreiving all the records from that table for that BOEKCODE value. As you are using GROUP BY, you don't need the B table data if you aren't aggregating anything from it, so using the R table's version is fine.

    Hi Sgmunson,

    Thanks for looking into this, I will look at the execution plan to see what is happening.

    From the 'B' table, I need the 'BOEKOMSCHRIJVING', that's why I've added the 'B' table.

    For the extra records, Every PA has (at least) one PR, each PR contains 1 R, and each R has one B