title: Joining 3 tables Oracle SQL
body: <p>I have 3 tables listing below:</p>
  
  <p>Table_A:</p>
  
  <pre><code>order_number | header_id
          123  | 80001
  </code></pre>
  
  <p>Table_B</p>
  
  <pre><code>   header_id | line_id | quantity
         80001 | 10001   | 1
         80001 | 10002   | 3
         80001 | 10003   | 5
  </code></pre>
  
  <p>Table_C</p>
  
  <pre><code>   header_id | line_id | hold_price_id | released_flag
         80001 |   10001 | 2001          | Y
         80001 |   10002 | 2002          | Y
         80001 |   10003 | 2003          | N
  </code></pre>
  
  <p>I wrote a query as shown below:</p>
  
  <pre><code>SELECT A.order_number, A.header_id, B.line_id, B.quantity, C.hold_price_id, C.released_flag
  FROM Table_A a,
       Table_B b,
       Table_C c
  WHERE a.header_id = b.header_id
  AND   c.line_id = b.line_id
  AND   a.order_number = '123';
  </code></pre>
  
  <p>My desire output is as shown below:</p>
  
  <pre><code>   order_number | header_id | line_id | quantity | hold_price_id | released_flag
              123 |     80001 |   10001 | 1        | 2001          | Y
              123 |     80001 |   10002 | 3        | 2002          | Y
              123 |     80001 |   10003 | 5        | 2003          | N
  </code></pre>
  
  <p>However the query show me the below result:</p>
  
  <pre><code>order_number | header_id | line_id | quantity      | hold_price_id | released_flag
           123 |     80001 |   10001 | 1             | 2001          | Y
           123 |     80001 |   10001 | 3             | 2002          | Y
           123 |     80001 |   10001 | 5             | 2003          | N
           123 |     80001 |   10002 | 1             | 2001          | Y
           123 |     80001 |   10002 | 3             | 2002          | Y
           123 |     80001 |   10002 | 5             | 2003          | N
           123 |     80001 |   10003 | 1             | 2001          | Y
           123 |     80001 |   10003 | 3             | 2002          | Y
           123 |     80001 |   10003 | 5             | 2003          | N
  </code></pre>
  
  <p>Is it something wrong on my query? Please advice.</p>
  
  <p>Thank you!  </p>