Group by aggregation for table joins
See original GitHub issueUse case: Being able to aggregate data across multiple tables and grouping by certain fields.
Feature description: Let’s say I have two tables: tableA, tableB. tableA contains all of my metadata and tableB contains important timing information relevant to a record in tableA.
For example: tableA contains the following columns:
id STRING,
browser STRING,
browserversion STRING,
os STRING
tableB contains the following columns:
testid STRING,
testname STRING,
startdate LONG,
enddate LONG,
time STRING
Example query:
SELECT avg(tableb.time), tableb.testname FROM tableb INNER JOIN tablea on tableb.testid = tablea.id GROUP BY tableb.testname;
Error that I currently get:
ValidationException[GROUP BY on JOINS is not supported]
Issue Analytics
- State:
- Created 7 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
An Introduction to Using SQL Aggregate Functions with JOINs
Powerful SQL tools. Let's see how they cooperate paired with LEFT JOIN, SUM and GROUP BY perform computations on multiple tables.
Read more >Join tables with Aggregate value - sql server - Stack Overflow
Try this one - SELECT a.Name , Value1 = ISNULL(Value1, 0) , Value2 = ISNULL(Value2, 0) FROM ( SELECT Name , Value1 =...
Read more >SQL join tables with group by and order by - w3resource
In this page, we are going to discuss the usage of GROUP BY and ORDER BY clause within a join. Example: Sample table:...
Read more >Working With Joins, Aggregations, and Built-In Functions
Joins are the mechanism used to link tables in a dataset together for the duration of a query so that related data in...
Read more >A Practical Approach to Groupjoin and Nested Aggregates
c_id. GROUP BY cust.id. In a traditional implementation, we answer the query by building two hash tables on the same key, one for...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
We’ve merged support for GROUP BY on joins via https://github.com/crate/crate/pull/5339 - it’ll be part of the next feature release (1.2)
What is the status on this issue?