Skip to content
Advertisement

Improve Query to not have to run multiple times?

I currently have this working query. However, I have to run it multiple times with different parameters to get the total result. I’m wondering if there’s a way I can run a loop or create a column for each query within one query so I can get the complete result without commenting in specific params and then commenting out (Running it multiple times). Is there a way to create a column for ether, BTC, tether, and usd coin?

Advertisement

Answer

As Nick mentioned in the comments , the “group by” has “comments_1” but it is not there in column projection which needs fixed. “Filter” clause can be used to create a column for each type of metrics. Here is the SQL which needs validated(could not validate as there is no sample data). From the output of this SQL , the column of interest can be visually chosen.

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement