Click here to Skip to main content
15,884,298 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello,

Please I'm having a challenges with SQL. I have two data tables;

TABLE A: contains just emails

TABLE B: contains emails, name, city, country, language...

I want a query that can take emails from TABLE A, match the existing email in TABLE B, and give me their other data(name, country, language...)

Please kindly help me.

Thank you.
Posted

There you go:
SQL
SELECT B.*
FROM TableA AS A
JOIN TableB AS B ON A.Email = B.Email
 
Share this answer
 
Comments
namo77 20-Mar-15 14:49pm    
I tried it. I didn't work.

Here is the query i wrote:

SELECT unverified_data_angola.*
FROM unverified_data_angola AS A
JOIN all_verified_data AS B ON A.Email = B.Email

Please help. Thank you
[no name] 20-Mar-15 14:55pm    
you mixed up two table names:

SELECT all_verified_data.*
FROM unverified_data_angola AS A
JOIN all_verified_data AS B ON A.Email = B.Email
namo77 21-Mar-15 3:07am    
Thanks for your help. I tweaked the query, and it worked. Here's what i did:
SELECT * FROM `all_verified_data` AS A JOIN `unverified_data_angola` AS B ON A.email = B.email
Thanks. Here is the query that worked.

SELECT * FROM `all_verified_data` AS A JOIN `unverified_data_angola` AS B ON A.email = B.email
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900