I have 1 table products and I would like to extract price of products with type A and B. I try to use INNER JOIN but it returns duplicate record.
This is the table:
id | Price | Date | Type | Size |
--------------------------------------------------------------------
1 | 1,00 | 01/11/2010 | A | 7,00 |
2 | 2,50 | 02/11/2010 | A | 8,00 |
3 | 2,50 | 03/11/2010 | A | 9,00 |
4 | 3,00 | 02/11/2010 | A | 10,00 |
5 | 4,00 | 03/11/2010 | A | 11,00 |
6 | 4,00 | 03/11/2010 | A | 12,00 |
7 | 5,00 | 03/11/2010 | A | 13,00 |
8 | 5,00 | 03/11/2010 | A | 14,00 |
9 | 6,00 | 03/11/2010 | A | 15,00 |
10 | 7,00 | 03/11/2010 | A | 16,00 |
11 | 1,00 | 03/11/2010 | B | 17,00 |
12 | 2,50 | 03/11/2010 | B | 18,00 |
13 | 3,00 | 03/11/2010 | B | 19,00 |
14 | 3,00 | 03/11/2010 | B | 20,00 |
15 | 5,00 | 03/11/2010 | B | 21,00 |
16 | 6,00 | 03/11/2010 | B | 22,00 |
17 | 7,00 | 03/11/2010 | B | 23,00 |
18 | 7,00 | 03/11/2010 | B | 24,00 |
And I would like to create a table/view or query existing table show like this:
Price | Date | Size A | Size B |
------------------------------------------------------------------------
1,00 | 01/11/2010 | 7,00 | 17,00 |
2,50 | 02/11/2010 | 8,00 | |
2,50 | 03/11/2010 | 9,00 | 18,00 |
3,00 | 02/11/2010 | 10,00 | 19,00 |
4,00 | 03/11/2010 | 11,00 | |
4,00 | 04/11/2010 | 12,00 | |
5,00 | 03/11/2010 | 13,00 | 21,00 |
5,00 | 04/11/2010 | 14,00 | |
6,00 | 05/11/2010 | 15,00 | |
7,00 | 06/11/2010 | 16,00 | 23,00 |
The new table it must be filtered by Date and Price