title: Unique Cross Join in SQL Table
body: <p>I'm trying to join two 'tables' in SQL in order to use the different columns to represent different parts of a line chart in SSRS Report Builder, including a shaded range, median line and a plotted line of results so it looks like the below image.</p>
  
  <p><img src="https://i.stack.imgur.com/jpx5l.png" alt="Expected outcome"></p>
  
  <p>I have one table with data to display a shaded range on the graph and a median line based on age.</p>
  
  <p>Example Table 1,</p>
  
  <pre><code>+---------+-----------------+------------+------------+
  | Age     | LowerRange      | UpperRange | Median     |
  +---------+-----------------+------------+------------+
  | 6       | 100             | 120        | 1          |
  | 8       | 200             | 400        | 4          |
  | 10      | 300             | 700        | 7          |
  | 12      | 400             | 1100       | 1          |
  | 14      | 500             | 4000       | 4          |
  | 16      | 600             | 7000       | 7          |
  | 18      | 700             | 11000      | 1          |
  | 20      | 800             | 40000      | 4          |
  | 22      | 900             | 70000      | 7          |
  +---------+-----------------+------------+------------+
  </code></pre>
  
  <p>I then have a query that joins a few tables into one table that produces results to plot on this graph as a dotted line plot.</p>
  
  <p>Example Table 2,</p>
  
  <pre><code>+---------+-------+
  | Age     | Value |
  +---------+-------+
  | 8       | 150   |
  | 9       | 270   |
  | 14      | 530   |
  | 22      | 980   |
  +---------+-------+
  </code></pre>
  
  <p>I cannot use two datasets on one single chart, so I decided to cross join the two tables, but it presents me with a table like this;
  Table 3</p>
  
  <pre><code>+---------+-----------------+------------+------------+---------+-------+
  | Age     | LowerRange      | UpperRange | Median     | Res.Age | Value |
  +---------+-----------------+------------+------------+---------+-------+
  | 6       | 100             | 120        | 1          | 8       | 150   |
  | 6       | 100             | 120        | 1          | 9       | 270   |
  | 6       | 100             | 120        | 1          | 14      | 530   |
  | 6       | 100             | 120        | 1          | 22      | 980   |
  | 8       | 200             | 400        | 4          | 8       | 150   |
  | 8       | 200             | 400        | 4          | 9       | 270   |
  | 8       | 200             | 400        | 4          | 14      | 530   |
  | 8       | 200             | 400        | 4          | 22      | 980   |
  | 10      | 300             | 700        | 7          | 8       | 150   |
  | 10      | 300             | 700        | 7          | 9       | 270   |
  | 10      | 300             | 700        | 7          | 14      | 530   |
  | 10      | 300             | 700        | 7          | 22      | 980   |
  | 12      | 400             | 1100       | 1          | 8       | 150   |
  | 12      | 400             | 1100       | 1          | 9       | 270   |
  | 12      | 400             | 1100       | 1          | 14      | 530   |
  | 12      | 400             | 1100       | 1          | 22      | 980   |
  | 14      | 500             | 4000       | 4          | 8       | 150   |
  | 14      | 500             | 4000       | 4          | 9       | 270   |
  | 14      | 500             | 4000       | 4          | 14      | 530   |
  | 14      | 500             | 4000       | 4          | 22      | 980   |
  </code></pre>
  
  <p>How can I combine the tables 1 and 2 to produce a single table with zero duplicates like table 4 below?</p>
  
  <p>Example of expected output,
  Table 4</p>
  
  <pre><code>+---------+-----------------+------------+------------+---------+-------+
  | Age     | LowerRange      | UpperRange | Median     | Res.Age | Value |
  +---------+-----------------+------------+------------+---------+-------+
  | 6       | 100             | 120        | 1          | 8       | 150   |
  | 8       | 200             | 400        | 4          | 9       | 270   |
  | 10      | 300             | 700        | 7          | 14      | 530   |
  | 12      | 400             | 1100       | 1          | 22      | 980   |
  | 14      | 500             | 4000       | 4          | -       | -     |
  | 16      | 600             | 7000       | 7          | -       | -     |
  | 18      | 700             | 11000      | 1          | -       | -     |
  | 20      | 800             | 40000      | 4          | -       | -     |
  | 22      | 900             | 70000      | 7          | -       | -     |
  +---------+-----------------+------------+------------+---------+-------+
  </code></pre>