Saturday 15 February 2014

MYSQL SELECT WHERE Clause : How to include a column from another table? -


In MYSQL, assume I have followed two tables.

"Profile":

  Full Name | Gender | Countrycode ----------------------------------- Alex | M | We benny M | Frank Cindy | F | UK   

"country":

  country_code | Country_name ----------------------------- jp | Japan us | | United States fr France SG | Singapore UK United Kingdom   

When querying "profile" in the table perspective, like:

  WHERE fullname = 'Cindy'   

Then in the results, how do I include a column from another table (to get results like this):

  fullname | Gender | CountryGoad | Country_name ------------------------------------------------ Cindy | F | UK United Kingdom    

Try the following:

  * Enter the natural country from the profile where the full name = 'Cindy'    

No comments:

Post a Comment