Showing posts with the label group-by

[FIXED] Find n consecutive business date where values are equal in Panadas data frames

Issue We need to return the list of dates for n consecutive business days ( Friday to Monday is 1 b…

[FIXED] Converting Python code to pyspark environment

Issue import pandas as pd temp = pd.DataFrame(data=[['a',0],['a',0],['a',0…

[FIXED] Unknown database function 'DATE_FORMAT' in OracleDb

Issue Below is how my BUS_DATA table looks like src="https://i.stack.imgur.com/ZvpOw.png&quo…

[FIXED] Get max date based on the URL string having multiple records

Issue This is my data, where I need to get last access date of every unique URL. DATA AccessDate …

[FIXED] Summarize a column with multiple boolean columns

Issue I have a sqlite database containing a table who looks like this, to store many to many relati…

[FIXED] Select first row in each GROUP BY group?

Issue As the title suggests, I'd like to select the first row of each set of rows grouped with…

[FIXED] Generated column from another table's column

Issue Transaction table: ID Name Price Amount

[FIXED] How to subtract two rows from two different selects?

Issue I'm trying to subtract the total number shares for each symbol from the sell orders and t…

[FIXED] Spark Dataframes - derive single row containing non-null values per key from multiple such rows

Issue I am a newbie to spark-scala and need some help from the community. This is an app log, eac…

[FIXED] Group dataframe by two columns and then find average count based on one of the groups

Issue Really struggling to get this solution. Suppose I have the dataframe below: SEX ITEM S…

[FIXED] Check if specific values in column follow each other for each id

Issue I have the following dataframe id | status ____________ 1 | reserved 2 | signed 1 | waiti…

[FIXED] Microsoft SQL Server 2017 - producing a count of tickets that are still open per month by team

Issue I have a faults table which contains the ticket information for calls raised by our I.T. Serv…

[FIXED] Comparing specific rows per a group of records

Issue I have a table that I want to monitor for differences in counts based on a group of records. …

[FIXED] SQL query to return percentage of rows where binary variable equals a value, by month

Issue I need to run a query that returns the % of rows where the Type column is equal to "Yes&…

[FIXED] Get multiple max values sorting date time

Issue Here is my sample data. DateAndTime column measured per 10 seconds. Date range is 6/30 ~ 8/…