I'm new to MySQL and I want to return data from two tables only when the Mobile numbers in both the table are same. I don't want any null
values. How can I achieve this?
Example:
Table A
UserID CandidateName CurrentMobile CurrentDistrict Email Centre
1 Max 98234 Chennai [email protected] A
2 Raju 97364 Salem [email protected] B
3 Ramesh 99873 Trichy [email protected] C
Table B
Name MobileNumber District
Maximus 98234 Salem
Ramesh 99873 Trichy
Venkat 98376 Chennai
I want the following result:
UserID CandidateName Name CurrentDistrict District Email Centre MobileNumber
1 Max Maximus Chennai Salem [email protected] A 98234
3 Ramesh Ramesh Trichy Trichy [email protected] C 99873
I tried to use UNION
, but it gives null
values in some columns and also returns all the data from both the tables.