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

'hasOwnProperty' in javascript -

How to put a lock and transaction on table using spring 4 or above using jdbcTemplate and annotations like @Transactional? -

How to understand 2 main() functions after using uftrace to profile the C++ program? -