Friday, 15 February 2013

sql server - Standardize SQL multiple AND/Where -


I am trying to make the following SQLs more efficient, but I have not yet successfully what I do not have. It returns an average of 800 rows in about 2 minutes. Any suggestions I can not use temp table?

  Select POP. Account_number, ip IP_IDRRC, POP.IP_Name_Full, INFO_Default_Hmp.Date_Solicitation, INFO.BAL_PRIN_AMT, UDD.USER_DEFINED_5V_14, POP.Process_Stop_Code, POP, IP, Information, INFO_Default_Hmp, INFO_Participation_Item, POP.Account_Number = POP.Account_Number and INFO.Appl_Id from POP.Mail_Code = POP.Appl_Id and INFO.Bank_Number = POP.Bank_Number and INFO_Default_Hmp.Bank_Number = POP.Bank_Number and INFO_Default_Hmp.Account_Number = POP.Account_Number and INFO_Default_Hmp .Appl_Id = POP.Appl_Id and POP.Bank_Number = INFO_Participation_Item.Bank_Number and POP.Appl_Id = INFO_Participation_Item .Appl_Id and POP.Account_Number = INFO_Participation_Item.Account_Number and INFO_Participation_Item.Involved_Party_Id_Investor = IP.Involved_Party_Id_Investor and UDD.Account_Number = POP.Account_Number and UDD.Bank_Number = POP.Bank_Number and POP .Appl_Id = UDD.Appl_Id) AND ((POP.Appl_Id = 'FL' and POP.Account_Status_Code = 'A' more info.bol_P_Print_Amt> 0 and UDD.User_Defined_5v_14 = 'S1'))  

Maximize usage

P> Also, tell us which RDBMS you are using by adding that tag to your post


No comments:

Post a Comment