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: è gratuito e ti dà accesso anche a Willi, l'assistente AI, e a tutta la Knowledge Base.

Prova a chiederlo a Willi

Willi, l'assistente AI della community, risponde a queste domande usando questo articolo e le altre fonti Faq400. È gratuito: iscriviti e ricevi subito la risposta.

Chi legge questo, legge anche