▲ | wvbdmp 14 hours ago | |||||||||||||||||||||||||
>subquery >less verbose Well… In any case, it depends. OP nicely guarded himself by writing “overusing”, so at that point his pro-tip is just a tautology and we are in agreement: not every use of DISTINCT is an immediate smell. | ||||||||||||||||||||||||||
▲ | Sesse__ 14 hours ago | parent [-] | |||||||||||||||||||||||||
What do you mean? Here are your real alternatives for doing a semijoin (assuming ANSI SQL, no vendor extensions):
Now tell me which one of these is the less verbose semijoin?You could argue that you could fake a semijoin using
or
but it doesn't give the same result if t1 has duplicate rows, or if there is more than one t2 matching t1. (You can try to fudge it by replacing * with something else, in which case the problem just moves around, since “duplicate rows” will mean something else.) | ||||||||||||||||||||||||||
|