simple query for 3 table JOIN

SELECT a.id,a.location_name,b.city_name,c.country_name FROM hca_location AS a JOIN hca_city AS b ON a.city = b.id JOIN hca_country AS c ON b.country = c.id WHERE b.is_active=’Y’ AND c.is_active=’Y’

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s