警告はどういう意味ですか?
2番目の例が最初の例よりも悪いのはなぜですか?
SELECT product_id, prod.name name, sample_id
FROM lims.sample JOIN lims.product prod USING (product_id)
対。
SELECT product_id, prod.name name, sample_id
FROM (SELECT sample_id, product_id FROM lims.sample)
JOIN lims.product prod
/* ADVICE: [131] This item has not been declared, or it refers to a label */
USING (product_id)
/* ADVICE:
ADVICE SUMMARY
Count Recommendation
----- --------------
1 [131] This item has not been declared, or it refers to a label
The Oracle equivalent error messages are PLS-00320 and
PLS-0321.
*/
参考:どちらのクエリも正常に実行され、同じ結果が返されます。