forum

Home / DeveloperSection / Forums / Query Between Two Tables Using Ruby

Query Between Two Tables Using Ruby

Anonymous User241718-May-2013
Hi Guys! 

How to used query between two table in rub?

I'm trying as following

contact = UserContact.find(:all,:select=>"distinct app_id,number",:conditions=>"number ='1234'")

arr=[]
contact.each do|c|
 arr << c.app_id
end
name=User.find(:all,:conditions=>"id in(#{arr.join(',')}")
I takes two much time Can i do this using join

Please help!
Thanks in advance!

Updated on 18-May-2013
I am a content writter !

Can you answer this question?


Answer

1 Answers

Liked By