Inner Join with SQL

G

gabriel

Hi everybody!

I have a table and a query and would like to create a query with SQL, which
has all the fields from the table plus one exlusive field from the query.

As I understood this is done by the INNER JOIN function and should look
similar to this approach:
SELECT
FROM Consulta2005 INNER JOIN ATRFazenda2
ON Consulta2005.Fazenda = ATRFazenda2.Fazenda;

Both table and query have an identical field (Fazenda).
I would like to know, what I have to write in the SELECT line to create the
query I mentioned above.

Many thanks in advance
gabriel
 
J

John Spencer

Assumption. Consulta2005 is the table and ATRFazenda2 is the query

SELECT Consulta2005.*, ATRFazenda2.[NameofDesiredField]
FROM Consulta2005 INNER JOIN ATRFazenda2
ON Consulta2005.Fazenda = ATRFazenda2.Fazenda;

Or list each of the fields you want to see
SELECT Consulta2005.[FieldNameA]
, Consulta2005.[FieldNameB]
....
, ATRFazenda2.[NameofDesiredField]
FROM ...
--
John Spencer
Access MVP 2002-2005, 2007-2008
Center for Health Program Development and Management
University of Maryland Baltimore County
..
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top