Skip to content

Postgresql Get Maximum value per day with corresponding time

I have the following table: I want to get maximum value along with Date,ReceivedTime. Expected Result: Answer This answer assumes that, in the event of two or more records being tied on a given day for the same highest value, you want to retain the single record with the most recent ReceivedTime. We can use D…

BigQuery – SQL UPDATE and JOIN

I have two tables. Table1 = dalio which is an event list with select customers. Table2 = master_list which is a master customer list from all past events. dalio has an “id” column that needs to be filled in with customer numbers, which can be pulled from master_list column called “customer_n…

Assistance with PERCENTILE_CONT function and GROUP By error

All, I am having problems with the below query. I am trying to get stat data from our database for the last 3 years but I keep getting the error message: ***Column ‘OC_VDATA.DATA1’ is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause.*** …