|
with (fld1, fld2, fld3) a as ( select xxfld1, xxfld2, xxfld3 from table1 where <stuff> ), ( fld4, fld5, fld6) b as ( select zzfld4, zzfld5, zzfld6 from table2 where <morestuff> ) select c.x, c.y, c.z from table3 c join a on a.fld1 = c.x and a.fld2 = c.y and a.fld3 = c.z exception join b on b.fld4 = c.x and b.fld5 = c.y and b.fld6 = c.z order by c.xVery powerful stuff. You can even do summary functions in the common table expressions and use them as if they were scalar values. Not magic though. Just like everything else, if you string enough of it together, the lights dim in Boston if you're within the continental US.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.