sql query to match condition from other table (time sensitive)

I know little SQL and could really use a hand here. I need to get the fields last_name, first_name and email from the table users and only if the entery with the same pkey in the table addresses, in the city column is Seattle.

So if the city in the addresses table is Seattle, go to the table users, find the same pkey and extract the first_name, last_name and email. Am I being clear?

Thanks very much for the help,
Ed Guntrum

select u.first_name,u.last_name,u.email from users u,adresses a where u.city='Seatle' and u.city=a.city;

hope this works for u

I think this is write query.

1 Like