ccurle
01-16-2007, 10:57 PM
I have to query 3 tables from a database. I am just using abbreviated table description since the tables are very large
Table A
ID_A
Name_A
Table B
ID_B
Name_B
Table C
ID_C
ShowName
ID_A
ID_B
Now, I need to query all 3 and have Table A and B show the name
Table C is the main table that I need. Table A and B are reference tables.
If I do a select TableA.Name_A, TableB.Name_B, TableC.ShowName WHERE TableC.ID_A = TableA.ID_A and TableC.ID_C = TableB.ID_B
It only shows the records in Table C that have a reference to Table A and B. If there is nothing in those fields, then it doesn't show. How can I query C to show all the records and the ID_A and ID_B to show their names if there is data, if not, just leave blank?
Table A
ID_A
Name_A
Table B
ID_B
Name_B
Table C
ID_C
ShowName
ID_A
ID_B
Now, I need to query all 3 and have Table A and B show the name
Table C is the main table that I need. Table A and B are reference tables.
If I do a select TableA.Name_A, TableB.Name_B, TableC.ShowName WHERE TableC.ID_A = TableA.ID_A and TableC.ID_C = TableB.ID_B
It only shows the records in Table C that have a reference to Table A and B. If there is nothing in those fields, then it doesn't show. How can I query C to show all the records and the ID_A and ID_B to show their names if there is data, if not, just leave blank?