Rails Arel: How to create query with "from" and subquery

1k views Asked by At

I have searched many places but found no result. I want to have a query like this:

SELECT * FROM( sub_query ) AS virtual_table

But it looks like Arel doesn't allow me to do so. Arel just allow some structure such as:

SELECT * FROM table_name as virtual_table

How can I overcome this limit in Arel.

0

There are 0 answers