I have 3 tables: posts, fans, comments and i want to use joinWith() to get the posts with their comments and the fan name (in fans table) for both post and comments. what i wrote is this query:
i tried it but i check the query in yii debugger and i get this query:
SELECT “FBC”.* FROM “facebook_comments” “CR” LEFT JOIN “facebook_fans” “FBF” ON “FBC”.“from_id” = “FBF”.“id” WHERE “facebook_comments FBC”.“reply_on” IN (‘1631717’, ‘1631724’);
it is correct but it gives me error in ‘WHERE’ clause,
i dont know why table name is written before the alias ‘FBC’ again in WHERE clause.