Relational Query With Through

Hello;

I have a db like this db and I have same model like it;

When I use this code:


$groups=Group::model()->with('roles','users')->findAll();

This code run correctly but when I use this code:


$groups=Group::model()->with('roles','users','comments')->findAll();

This error shows:


Syntax error or access violation: 1066 Not unique table/alias

therefore When I use two relations that is defined with Through in model this error will occur;

Please Help Me !

Hi,

Is that not a problem with ambiguous table aliases ?

See here and also the comments at the bottom of the page.