Skip to main content
Stack Overflow
  1. About
  2. For Teams
Filter by
Sorted by
Tagged with
0 votes
1 answer
99 views

I'm trying to calculate the percentage contribution of each firm to the total amount across all firms. Database: google-bigquery What I need (desired output): Sum usde_haircut_amt per firm Compute ...
3 votes
3 answers
164 views

I have a SQL table in postgres 14 that looks something like this: f_key data1 data2 fit 1 {'a1', 'a2'} null 3 1 {'b1', 'b2'} {'b3'} 2 2 {'c1', 'c2'} null 3 Note that data1 and data2 are arrays. I need ...
2 votes
2 answers
147 views

As Postgresql documentation states in # 36.12.4. Partial Aggregation aggregate functions can support partial aggregation. To do this with custom aggregate function as again the documentation says we ...
0 votes
1 answer
114 views

In SQL Server 2022, is there an aggregate function for doing a bit-wise OR against a particular column? -- Example table, data and output to show the different flags DECLARE @TEST TABLE (FLAGS TINYINT)...
2 votes
2 answers
114 views

I have a table with data on user applications. It contains several fields: employee_id text, date date, app_info jsonb. +-------------+------------+------------+ | employee_id | date | app_info ...
-1 votes
2 answers
193 views

My query: SELECT c.CustID, o.OrderID, SUM(ol.Qty * ol.Price) AS SUMOrder, AVG(SUM(ol.Qty * ol.Price)) OVER (PARTITION BY c.CustID) AS AVGAllOrders, COUNT(*) AS Countorders, SUM(...
1 vote
0 answers
112 views

Edit: Progressing into this problem analysis, the management of the dataset nested values with tools that Spark offers since 3.1.x seems required. → It's my manner of filling nested objects hold by ...
4 votes
5 answers
200 views

Product table with columns - PRODUCT_ID PRODUCT_NAME PRODUCT_ID PRODUCT_NAME 100 NOKIA 200 IPHONE 300 SAMSUNG 400 OPPO Sales table with columns - SALE_ID PRODUCT_ID YEAR QUANTITY Price SALE_ID ...
1 vote
1 answer
55 views

I have this query: SELECT organisation_id, count((j->>'invoiceId')) AS count, sum((j->>'advanceAmount')::numeric(20,4)) AS sum FROM runs LEFT JOIN jsonb_array_elements(...
0 votes
0 answers
94 views

I have a 106M dataframe with nested columns, that is, I have a few columns where the values are {[1,2,3,4,5], <timestamp>, 1, 2 ,3}. I'm trying to add a few more columns using when, then do an ...
1 vote
1 answer
125 views

I need group speed by ram and return MAX(speed), where at least one NULL in speed values will return NULL. ram speed 128 600 128 600 128 750 128 750 128 800 128 900 32 400 32 NULL 32 500 64 450 64 500 ...
0 votes
2 answers
65 views

I am trying to compute the number of events that take place within 30 minutes of one another (variable n_within_30) on the same date and in the same location. I have tried to partition and group by ...
0 votes
1 answer
86 views

I need to create an aggregation for each housing type (column type) for each destination. There is a hierarchy (product->sub_product) and (category->sub_category) and also product can have ...
0 votes
0 answers
52 views

Have the following tables: Projects: id name 1 Project 1 2 Project 2 3 Project 3 Assignments: id project_id user_id 1 1 1 2 1 3 3 1 2 4 2 1 5 3 1 6 3 2 Users: id name 1 User 1 2 User 2 3 User 3 I'm ...
0 votes
0 answers
16 views

I'm having an issue with my assignment where it's giving me more than one "minimum" date. The problem is to create a table variable that shows the earliest invoice sent by each vendor, ...

15 30 50 per page
1
2 3 4 5
...
395

AltStyle によって変換されたページ (->オリジナル) /