mysql multiple joins select * code example
Example 1: multiple joins mysql
SELECT dashboard_data.headline, dashboard_data.message, dashboard_messages.image_id, images.filename
FROM dashboard_data
INNER JOIN dashboard_messages
ON dashboard_message_id = dashboard_messages.id
INNER JOIN images
ON dashboard_messages.image_id = images.image_id
Example 2: using multiple join in sql
SELECT e.FIRST_NAME ,
d.DEPARTMENT_NAME ,
l.CITY ,
c.COUNTRY_NAME ,
r.REGION_NAME
FROM EMPLOYEES e
INNER JOIN DEPARTMENTS d on e.DEPARTMENT_ID = d.DEPARTMENT_ID
INNER JOIN LOCATIONS l on l.LOCATION_ID = d.LOCATION_ID
INNER JOIN COUNTRIES c on l.COUNTRY_ID = c.COUNTRY_ID
INNER JOIN REGIONS r on c.REGION_ID = r.REGION_ID ;