Suppose that I have a customers table which has an account_number and a billing_account_number, if I link to another table which I need to test for either, I could use the following or clause:
select c.name
from customers c
,left join credit_terms ct on account = c.account_number
or account = c.billing_account
However, I have found that the following works equally
select c.name
from customers c
,left join credit_terms ct on account in (c.account_number, c.billing_account)
Now suppose that credit_terms.account is indexed, would that index get used in both cases? Are both statements just as equal? Is there any cost associated with one or the other?
I do apologise for being naive though I am fairly new to moderate levels of SQL.