ComplexSQLpostgresqueryintoActiveRecordnotation?希望ActiveRecord向导可以帮助我确定这种查询是否可以使用AR语句完成,即无需执行原始SQL或深入Arel?我接近了,但似乎无法弄清楚如何添加子查询。我在Rails5.1.1上。123456SELECTs.idASstock_id,s.count,adjustments.countASadjustment_count,adjustments.reasonASadjustment_reasonFROM(SELECT*FROMstocksWHEREinventory_id=6)ASsLEFTJO