I am having difficulty trying to put together a query (Oracle 8i) that would give me all records from one table and the corresponding records from another table in which the value is specified. I have tried various subqueries with left joins etc and haven't had any luck.
For example, list all names (Table1) and the specified codes (Table2) where value = S
Table1
id name
1 A
2 B
3 C
4 D
5 E
Table2
id value code
1 R X
1 S Y
2 S Z
2 T Y
3 U X
4 S Y
Desired Results: (known value = S)
name code
A Y
B Z
C
D Y
E
Any help would be appreciated...
For example, list all names (Table1) and the specified codes (Table2) where value = S
Table1
id name
1 A
2 B
3 C
4 D
5 E
Table2
id value code
1 R X
1 S Y
2 S Z
2 T Y
3 U X
4 S Y
Desired Results: (known value = S)
name code
A Y
B Z
C
D Y
E
Any help would be appreciated...