3 ms·
I see it as WHERE clause joining is the "can't mess it up" way to do it, and JOIN clause joining is "better in some situations". Imagine you're using SQL fragm
by inanutshellus 2y ago
I see it as WHERE clause joining is the "can't mess it up" way to do it, and JOIN clause joining is "better in some situations".
Imagine you're using SQL fragments. Using JOIN clauses make your code extremely clean:
<sql id="getRecentReturns">
<fragment id="ReturnOrderFragment">
where returns.order_date between sysdate - 30 and sysdate <------- Nice, clean code. No chance bugs from forgetting to add `returns.order_type = "Return"` or `employee.customer_type = "Employee"` or whatever.
</sql>
That said - if the guy making the table didn't make an index that includes your attribute (order_type and customer_type above), don't use it."