SQL query (Acess) help

Status
Not open for further replies.

Yagisama

Ars Legatus Legionis
33,190
Subscriptor
I don't have any experience with databases and I'd appreciate any help here. I have an access database (accdb) with numerous tables. Each table has one or more keys.

For example:

Table 1:

key first_name middle_name last_name

Table 2:

key street_name city_name zip_code

My goal is to specify the keys for all tables and have it return all the associated data (rows). I had no luck with the Access Query Wizard. Is this something reasonable to do with (manual) SQL queries?

I'm hoping that this is something that's done often and there is an easy way to do it, else I will look into figuring out SQL syntax/queries.
 

SpeedRacer

Ars Centurion
211
Subscriptor++
Perhaps I'm a little unclear on the question, but I think you're looking for:

Code:
select *
from   table_1
where  first_name = 'foo'
and    middle_name = 'b'
and    last_name = 'bar';

That will return the row from table_1 where the key values match those provided. Since you indicated that the key consists of those three fields, and primary keys are unique, you should only receive one row.

Am I interpreting your question correctly? Are you looking for something more than a basic query?
 
Status
Not open for further replies.