Left join ON multiple columns?

Jaxel

Well-known member
Is something like this possible?
Code:
SELECT EWRrio_streams.*,
    FROM EWRrio_streams
    LEFT JOIN EWRcanal_channels ON (
        EWRcanal_channels.service_id = EWRrio_streams.service_id AND
        EWRcanal_channels.channel_value1 = EWRrio_streams.channel_value1 AND
        EWRcanal_channels.channel_value2 = EWRrio_streams.channel_value2
        )
ORDER BY EWRrio_streams.stream_viewers DESC
 
Is something like this possible?
Code:
SELECT EWRrio_streams.*,
    FROM EWRrio_streams
    LEFT JOIN EWRcanal_channels ON (
        EWRcanal_channels.service_id = EWRrio_streams.service_id AND
        EWRcanal_channels.channel_value1 = EWRrio_streams.channel_value1 AND
        EWRcanal_channels.channel_value2 = EWRrio_streams.channel_value2
        )
ORDER BY EWRrio_streams.stream_viewers DESC

SELECT * FROM table1
INNER JOIN table2 ON table2.id = table1.id
LEFT JOIN table3 ON table3.id = table2.id

i've written an example for you.
 
Is something like this possible?
Code:
SELECT EWRrio_streams.*,
    FROM EWRrio_streams
    LEFT JOIN EWRcanal_channels ON (
        EWRcanal_channels.service_id = EWRrio_streams.service_id AND
        EWRcanal_channels.channel_value1 = EWRrio_streams.channel_value1 AND
        EWRcanal_channels.channel_value2 = EWRrio_streams.channel_value2
        )
ORDER BY EWRrio_streams.stream_viewers DESC
Yep, you can (just like that).
 
Back
Top Bottom