sql - Arel (Rails) Is it possible to make complex query? -


i need create query db using any/all. after research arel possibilities found out arel doesn't have short commands (like eq, lt, gt etc) has arel::sqlliteral 1 example. me not obviousl how can use classic query this:

select column_name(s) table_name column_name operator (select column_name table_name condition); 

instead of query in example. show me how should like?

you may activerecord methods, without usage of arel:

sub_query = model.select(:column_name).where(condition).to_sql model.   select("column_name(s)").   where("column_name operator (#{sub_query})") 

Comments

Popular posts from this blog

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -