Hey,
i’m having 2 tables:
TABLE A
id
name
b_id #id from TABLE B
TABLE B
id
name
the problem is i want all the objects form table b where there’s no
record for in table a.
Hey,
id
name
b_id #id from TABLE B
id
name
the problem is i want all the objects form table b where there’s no
record for in table a.
so0ly wrote:
id
namethe problem is i want all the objects form table b where there’s no
record for in table a.
B.find( :all,
:select => ‘b.*’,
:joins => ‘left join a on b.id = a.b_id’,
:conditions => ‘a.b_id is null’ )
–
We develop, watch us RoR, in numbers too big to ignore.
Mark Reginald J. wrote:
so0ly wrote:
id
namethe problem is i want all the objects form table b where there’s no
record for in table a.B.find( :all,
:select => ‘b.*’,
:joins => ‘left join a on b.id = a.b_id’,
:conditions => ‘a.b_id is null’ )–
We develop, watch us RoR, in numbers too big to ignore.
thnx
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs