i have query this:
select a.number, a.name, b.name1 a,b a.number not in (select number c) , a.name = b.name1
this query takes long time run. think because of subquery.
is possible avoid using subquery in case?
you can use code alternative results.
select a.number, a.name, b.name1 join b on a.name = b.name1 left join c on a.number = c.number c.number null;
you must check make sure have defined indexes on table unless query full table scans on each execution. not noticeable when data in table small, start slower table grows.
you can explain on query check execution plan, , optimise accordingly.
explain select a.number, a.name, b.name1 join b on a.name = b.name1 left join c on a.number = c.number c.number null;
Comments
Post a Comment