How do you do a joint query when your four tables are not related?
-》Recently I am doing a cross-table query of database tables divided by month. gem 'active_record_union' This will be suitable for you and help you encapsulate the union
If the amount of data is not large, you can refer to the union mentioned above. If the amount of data is large, it is recommended to query in pieces and then merge them in the program...
How do you do a joint query when your four tables are not related?
-》Recently I am doing a cross-table query of database tables divided by month.
gem 'active_record_union'
This will be suitable for you and help you encapsulate the unionOf course, check the union keyword in SQL
The correct solution above, union merges the result set
If the amount of data is not large, you can refer to the union mentioned above. If the amount of data is large, it is recommended to query in pieces and then merge them in the program...