I would like to join on a large list of integers in SQL Server instead of a big IN clause. My query : SELECT mmr.idContact, mmR.idQuestion as IdQuestion, MIN(mmR.idResponse) AS IdResponse FROM MatchResponses mmR –JOIN Contact c on c.idContact = mmR.idContact //to show the linked ids JOIN Contact c on c.idSpecific in (1,2,3…10000) WHERE myId= […]
Categories
Optimize a large in clause from list of integer
- Post author By Full Stack
- Post date March 5, 2021
- No Comments on Optimize a large in clause from list of integer
- Tags 2, 3...10000) WHERE myId= 300 GROUP By mmR.idContact, I can join mmR and COntact with an idContact. The query takes 44s I would like to make it shorter using a JOIN How can I declare the intege, I would like to join on a large list of integers in SQL Server instead of a big IN clause. My query : SELECT mmr.idContact, idQuestion The IN clause is way too long, MIN(mmR.idResponse) AS IdResponse FROM MatchResponses mmR --JOIN Contact c on c.idContact = mmR.idContact //to show the linked ids JOIN Conta, mmR.idQuestion as IdQuestion, mmr.idQuestion order by idContact