probiert und nachgelesen ...

SELECT u.* FROM users u LEFT JOIN members m ON u.id=m.user_id LEFT JOIN members_subcats s ON m.subcat_id=s.id WHERE u.member=1 AND u.id IS NULL
SELECT u.* FROM users u LEFT JOIN members m ON u.id=m.user_id LEFT JOIN members_subcats s ON m.subcat_id=s.id WHERE u.member=1 AND u.id IS NOT NULL
SELECT u.* FROM users u LEFT JOIN members m ON (u.id=m.user_id) LEFT JOIN members_subcats s ON (m.subcat_id=s.id) WHERE u.member=1 AND u.id IS NULL
SELECT u.* FROM users u LEFT JOIN members m ON (u.id=m.user_id) LEFT JOIN members_subcats s ON (m.subcat_id=s.id) WHERE u.member=1 AND u.id IS NOT NULL
SELECT u.* FROM users u LEFT JOIN members m ON (u.id=m.user_id) LEFT JOIN members_subcats s ON (m.subcat_id=s.id) WHERE u.member=1 AND (u.nickname='hugo' OR u.id=12)
Kommentar