RockManFree
Technical User
- Dec 24, 2011
- 3
I need a SQL query to return ALL fields of Table1 and any fields from Table2 where "Slot" is equal.
Table1 has one field named "Slot" and it has 10 rows of sample data (The data = 01,02,...,10)
Table2 has three fields named "Slot" "Contents" and "Status" with the following sample data (it only has three records):
Slot=1 Contents=Red Status=New
Slot=6 Contents=Blue Status=New
Slot=8 Contents=Green Status=Old
The final outcome should look like this: (I need the SQL code that would produce this)
SLOT CONTENTS STATUS
1 Red New
2
3
4
5
6 Blue New
7
8 Green Old
9
10
Please note that all slots 1-10 are reported from Table1 even tho there is no records in Table2 for some of the Slots.
Thank you!
Table1 has one field named "Slot" and it has 10 rows of sample data (The data = 01,02,...,10)
Table2 has three fields named "Slot" "Contents" and "Status" with the following sample data (it only has three records):
Slot=1 Contents=Red Status=New
Slot=6 Contents=Blue Status=New
Slot=8 Contents=Green Status=Old
The final outcome should look like this: (I need the SQL code that would produce this)
SLOT CONTENTS STATUS
1 Red New
2
3
4
5
6 Blue New
7
8 Green Old
9
10
Please note that all slots 1-10 are reported from Table1 even tho there is no records in Table2 for some of the Slots.
Thank you!