Subject | Re: [IBO] Links question |
---|---|
Author | Svein Erling Tysvaer |
Post date | 2003-06-26T13:04:40Z |
Ah, my turn to ask a question, since this is something partially relevant
for us. We have a situation where for some older records we do not have a
link and has set the value to 0 for such records. It would be something like
records)
I'm under the impression that it is better to have where criteria in the
JOIN part than join criteria in the WHERE clause and since this is an or
between something that partly is a join and partly is a where, I've simply
guessed that we better put it in the join clause (though I haven't been
100% consistent). What is the correct answer for such a question, or am I
simply free to choose between two wrong solutions?
Set
for us. We have a situation where for some older records we do not have a
link and has set the value to 0 for such records. It would be something like
>select t1.pk1, t1.pk2, t1.col1, t1.col2, t2.cola, t2.colb(and then of course a where clause, I've no intention to return 2 million
>from atable t1
>join btable t2
>on t2.fk1 = t1.pk1
>and (t2.fk2 = t1.pk2 or t2.fk2 = 0)
records)
I'm under the impression that it is better to have where criteria in the
JOIN part than join criteria in the WHERE clause and since this is an or
between something that partly is a join and partly is a where, I've simply
guessed that we better put it in the join clause (though I haven't been
100% consistent). What is the correct answer for such a question, or am I
simply free to choose between two wrong solutions?
Set