Use table column value for LIMIT when performing join
问题 I have a situation where I'm performing a join between two tables, and I need a value from one table to be used as a LIMIT factor for a subquery in the join. Assume I have the following [extremely simplified] tables - data: experiment_id | value --------------|-------- 1 | 2.5 1 | 2.6 1 | 4.5 1 | 2.3 1 | 3.5 1 | 2.8 2 | 2.3 2 | 1.2 2 | 1.1 2 | 3.6 2 | 3.8 2 | 4.1 2 | 7.9 2 | 4.2 2 | 1.0 data_clip: experiment_id | clip_index --------------|------------ 1 | 3 2 | 5 I need to sum each experiment