sql - Sum of Quantities by Member -
There was a custom field "member_name" created for the SQL statement for Word, which was created in order 3 in key = member_name Goes under. I need to create a report that shows the amount of SM (according to key = "_qty") according to member number when the tables: Order1 - order1_id, order3_id order2 - order2_id, key, value order3 - order3_id, key, value example: order1 order1_id - order3_id 2 - 292 3 - 292 4 - 281 order2 order2_id - key - value 2 - '_qty' - 1 to 3 - '_qty' - 2 4 - '_qty' - 1 order3 order3_id - key - value 292 - 'MEMBER_NAME' - John 292 - 'MEMBER_NAME' - John 281 - 'MEMBER_NAME' - Bill Desired results: P> John 3 Bill 2 I am working with: SELECT order3 .value, a.member_count (from order3 intermediate order3 (select value, sum (*) in value Order3.order3_id = order1.order1_id a) From order 2. Order3_id = order1.order1_id a) From order 2. Order2.value = '_ quantity...