I know this may be an easy question, but I've been stumped on this for the past hour and am not sure what terms to lookup that accurately describe what I am trying to do.
I have a MySQL database with two tables. Countries and Regions. The Regions table has two columns, id and name. An example of a row would be 1, north-america.
In the Countries table, there's a column named RegionID that would have a 1 if the country's region is north-america.
How can I grab the "north-america" in my query instead of printing out "1"?
Here's my SELECT that I am stumped on:
SELECT A.name, A.regionID FROM countries A, regions B ORDER BY A.name ASC
SELECT A.name, A.regionID, b.Name
FROM countries A
Join regions B
on B.id = A.RegionId
ORDER BY A.name ASC
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With