T
Tim
I have two tables, and one giving extra information about this
combination.
When I use the query "SELECT * FROM TableA,TableB" I get the desired
records, but I want to ignore the records that already exist in TableC
and show a specific column of TableC instead otherwise empty.
I've been trying subqueries and joins for a few days now to get the
desired result, but nothing will give me what I'm looking for. Maybe my
knowlegde on SQL is too limited, so please enlight me...
TableA
-----------
1 - First A
2 - Second A
3 - Third A
TableB
----------
1 - First B
2 - Second B
3 - Third B
TableC
----------
1 - 1 - 1 - FirstAFirstB
2 - 1 - 3 - FirstAThirdB
With the basic query I would get
1 - First A - 1 - First B - empty
1 - First A - 2 - Second B - empty
1 - First A - 3 - Third B - empty
2 - Second A - 1 - First B - empty
2 - Second A - 2 - Second B - empty
2 - Second A - 3 - Third B - empty
3 - Third A - 1 - First B - empty
3 - Third A - 2 - Second B - empty
3 - Third A - 3 - Third B - empty
What I want to become is
1 - First A - 1 - First B - FirstAFirstB
1 - First A - 2 - Second B - empty
1 - First A - 3 - Third B - FirstAThirdB
2 - Second A - 1 - First B - empty
2 - Second A - 2 - Second B - empty
2 - Second A - 3 - Third B - empty
3 - Third A - 1 - First B - empty
3 - Third A - 2 - Second B - empty
3 - Third A - 3 - Third B - empty
Many thanks in advance!
combination.
When I use the query "SELECT * FROM TableA,TableB" I get the desired
records, but I want to ignore the records that already exist in TableC
and show a specific column of TableC instead otherwise empty.
I've been trying subqueries and joins for a few days now to get the
desired result, but nothing will give me what I'm looking for. Maybe my
knowlegde on SQL is too limited, so please enlight me...
TableA
-----------
1 - First A
2 - Second A
3 - Third A
TableB
----------
1 - First B
2 - Second B
3 - Third B
TableC
----------
1 - 1 - 1 - FirstAFirstB
2 - 1 - 3 - FirstAThirdB
With the basic query I would get
1 - First A - 1 - First B - empty
1 - First A - 2 - Second B - empty
1 - First A - 3 - Third B - empty
2 - Second A - 1 - First B - empty
2 - Second A - 2 - Second B - empty
2 - Second A - 3 - Third B - empty
3 - Third A - 1 - First B - empty
3 - Third A - 2 - Second B - empty
3 - Third A - 3 - Third B - empty
What I want to become is
1 - First A - 1 - First B - FirstAFirstB
1 - First A - 2 - Second B - empty
1 - First A - 3 - Third B - FirstAThirdB
2 - Second A - 1 - First B - empty
2 - Second A - 2 - Second B - empty
2 - Second A - 3 - Third B - empty
3 - Third A - 1 - First B - empty
3 - Third A - 2 - Second B - empty
3 - Third A - 3 - Third B - empty
Many thanks in advance!