Knowledge Base

Blog Faq400

SQL “Lateral Join” … do you know this SQL join? (EN)

blog
Last Updated on 7 September 2019 by Roberto De Pedrini In those days, on an Italian newsgroup, it.comp.as400, came up an interesting discussion about LATERAL JOIN: a lot of people don’t even know this type of join, but it’s so powerful and let you simplify your SQL code. I created some tables with data and some views so you can try by yourself: download source sql code from this link: Lateral-Join-Example-DB2-for-i-1 Download We have got a table with carmakers, one with model type and one with sales figures and data… we want to get out one row only for each carmaker with the most sold model: we could play with some OLAP functions (row_number and so on) or we can simply use LATERAL JOIN (Cros …

Riservato agli iscritti

Per leggere l'articolo completo serve un account Faq400. È gratis, e con lo stesso account fai domande a Willi e leggi tutto l'archivio.

Prova a chiederlo a Willi

Willi risponde usando questo articolo e gli altri contenuti di Faq400, e ti dice da dove prende ogni frase. Serve un account: è gratis.

Chi legge questo, legge anche