Subject [firebird-support] Re: Self-Joined Items Master and transactions stock ledger
Author Svein Erling Tysvaer
Bhavbhuti Nathwani wrote:
> But I see the efficiency you are suggesting in using a JOIN. Will it affec=
> t much if I change your suggested
>> JOIN gttItemsSelected gis on p.iID =3D gis.ID
>> WHERE TRIM(gis.JobID) =3D '_2M60RJ9T4'
> to=20
> JOIN gttItemsSelected gis on p.iID =3D gis.ID
> AND TRIM(gis.JobID) =3D '_2M60RJ9T4'

As long as this is an inner join, these two should be identical,
Bhavbhuti. The one thing maybe worth considering, is to remove TRIM and
add an index for gttItemsSelected.JobID, but that is only worth it if
there are quite a few jobs in gttItemsSelected.