How to reduce execution time for this sql query

17 Views Asked by At

i have a select query in sql server 2008. It has a more tham million records .It is taking longer time to execute

select ItemCode ,sum(isnull(QtyIn,0)-isnull(QtyOut,0))BalQty from ItemMaster where DocDate <='2023-12-28'

group by ItemCode

This is taking more than 5 mins

0

There are 0 best solutions below