---
title: "How to Use Multiple Joins in SQL: Best Example"
description: "Here is the best example of writing an SQL query with multiple JOIN statements. https://srinimf.com/2016/09/13/exception_joins/. Photo by Evie Shaffer on Pexels.com. SQL Query with multiple Join State..."
url: https://srinimf.com/2014/09/10/how-to-use-multiple-joins-in-db2/
date: 2014-09-10
modified: 2026-10-10
author: "Srini"
image: https://i0.wp.com/srinimf.com/wp-content/uploads/2014/09/pexels-photo-5591676.jpeg?fit=1880%2C1253&ssl=1
categories: ["DB2", "SQL"]
tags: ["DB2 Joins"]
type: post
lang: en
---

# How to Use Multiple Joins in SQL: Best Example

Here is the best example of writing an SQL query with multiple `JOIN` statements.

Related[Exception JOIN in SQL: How to Write Correctly – And Best Example](https://srinimf.com/2016/09/13/exception_joins/)

![](https://i0.wp.com/srinimf.com/wp-content/uploads/2014/09/pexels-photo-2512281.jpeg?resize=971%2C1300&ssl=1)*Photo by Evie Shaffer on [Pexels.com](https://www.pexels.com/photo/pink-and-white-flower-with-white-background-2512281/)*

## SQL Query with multiple Join Statements

```
SELECT m.f1, o.f1, s.f1
FROM Material m
LEFT OUTER JOIN Catalog c
ON m.MaterialName = c.MaterialName
AND m.EffectiveDate = c.EffectiveDate
AND c.MaterialType = 'X1' AND (c.MaterialName Like 'xyz%' OR
c.MaterialName Like '%abc')
LEFT OUTER JOIN OrderHeader o
ON o.OrderList = m.OrderList
AND o.OrderDate BETWEEN '01-01-2004' AND '12-31-2004'
LEFT OUTER JOIN Ship s
ON o.OrderList = s.OrderList
AND s.ShipVendorID in ('UPS','YF')
```

Related

- [Join Vs Sub-query Top Differences to Read Today](https://srinimf.com/2010/04/20/db2-join-vs-sub-query/)DateApril 20, 2010
- [DB2 Tutorial For Software Developers (4 of 5)](https://srinimf.com/2015/08/06/mainframe-db2-tutorial-for-software-developers-4-of-5/)DateAugust 6, 2015
- [DB2 SQL Query Performance Tuning (3 of 3)](https://srinimf.com/2015/05/20/start-tuning-your-db2-sql-query-part-1/)DateMay 20, 2015

### Share this:

-
- [Tweet](https://twitter.com/share)
- [![](https://i0.wp.com/assets.pinterest.com/images/pidgets/pinit_fg_en_rect_gray_20.png)](https://www.pinterest.com/pin/create/link/?url=https%3A%2F%2Fsrinimf.com%2F2014%2F09%2F10%2Fhow-to-use-multiple-joins-in-db2%2F&media=https%3A%2F%2Fi0.wp.com%2Fsrinimf.com%2Fwp-content%2Fuploads%2F2014%2F09%2Fpexels-photo-5591676.jpeg%3Ffit%3D1200%252C800%26ssl%3D1&description=How%20to%20Use%20Multiple%20Joins%20in%20SQL%3A%20Best%20Example)
-
- [Share on Tumblr](https://www.tumblr.com/share)
- [Share on WhatsApp (Opens in new window) WhatsApp](https://srinimf.com/2014/09/10/how-to-use-multiple-joins-in-db2/?share=jetpack-whatsapp)
- [More](#)
-

- [Print (Opens in new window) Print](https://srinimf.com/2014/09/10/how-to-use-multiple-joins-in-db2/?share=print)
- [Share on Reddit (Opens in new window) Reddit](https://srinimf.com/2014/09/10/how-to-use-multiple-joins-in-db2/?share=reddit)
- [Share on Telegram (Opens in new window) Telegram](https://srinimf.com/2014/09/10/how-to-use-multiple-joins-in-db2/?share=telegram)
- [Email a link to a friend (Opens in new window) Email](mailto:?subject=%5BShared%20Post%5D%20How%20to%20Use%20Multiple%20Joins%20in%20SQL%3A%20Best%20Example&body=https%3A%2F%2Fsrinimf.com%2F2014%2F09%2F10%2Fhow-to-use-multiple-joins-in-db2%2F&share=email)
-

### Like this:

Like Loading…
