# SQL Query

**URL:** <https://forum.kirupa.com/t/sql-query/228390>\
**Category:** Uncategorized\
**Created:** [June 7, 2007, 11:33am UTC](https://forum.kirupa.com/t/sql-query/228390 "2007-06-07T11:33:27Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![J\_S](https://avatars.discourse-cdn.com/v4/letter/j/9de0a6/32.png) [@J\_S](https://forum.kirupa.com/u/J_S)\
**Post date:** [June 7, 2007, 11:33am UTC](https://forum.kirupa.com/t/sql-query/228390/1 "2007-06-07T11:33:27Z")

</div>

Our web developer has left our business, and we need to make a small amendment to our SQL-based website, only I don’t really know SQL. Here is what tables we have, and what we need to output. What would be the SQL query we need?

**Table ‘order’:**  
Order ID Linecount Status  
1234 3 OK  
1235 1 Unpaid  
1236 2 In Progress

**Table ‘orderline’:**  
OrderlineID Order ID Value  
525 1234 94  
526 1234 16  
527 1234 37  
528 1235 762  
529 1236 124  
530 1236 432

**Required Output:**  
Order ID Orderline Status Value  
1234 1 OK 94  
1234 2 OK 16  
1234 3 OK 37  
1235 1 Unpaid 762  
1236 1 In Progress 124  
1236 2 In Progress 432
