SELECT *
FROM (SELECT c.id,
c.name,
cc.name AS cat_name,
p.basic
FROM channel c
LEFT JOIN package p ON c.package_id = p.id
LEFT JOIN channel_category cc ON cc.id = c.category_id
WHERE TRUE) t1
LEFT JOIN (SELECT is_subscribed,
id AS user_id
FROM user
WHERE id = 'tester') t2 ON TRUE
LEFT JOIN (SELECT channel_id AS addon_id
FROM user_channel
WHERE user_id = 'tester') t3 ON t3.addon_id = id;
Title:
JOIN query example
Description:
SELECT * FROM (SELECT c.id, c.name, cc.name AS cat_name, p.basic FROM channel c LEFT...
...
Rating:
4