1

I am using inner join on 3 tables and one of my columns in one table is comma separated values(varchar) like m03412,3456,skeys and I am using FIND_IN_SET in one of the inner joins.

Query takes around 3 mins .

Is there any way to reduce the time by indexing?

I have 2 tables

user

userid ,
managerid ,
training_title, status and approverid ....

details

userid and name

Select a.userid as userid, a.training_title as training_title,
      a.status as status,c.userid as approverid,b.name as 'Manager_Name',
      c.name as 'ApproverName'

from
      user  a 
       join details  b on a.managerid = b.userid
       join details  c on find_in_set(c.userid,a.approverid) > 0
       where a.managerid=@mid and a.approverid <> '' 
       group by approverid order by ApproverName
Learner2011
  • 287
  • 2
  • 6
  • 25

0 Answers0