Skip to content
Advertisement

I need to optimize this MYSQL query

I have tried NOT EXIST but didn’t get expected result

can’t do index since duplicate entries of student_id,status are valid entries,Need to reduce execution time since the table has large number of data.

Advertisement

Answer

You can try query with JOIN condition:

Here the fiddle SQLize.online

Sure that your tables have index on student_id field. Since you filter by status field, so index on this field can improve the query performance

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement