Skip to content
Advertisement

Tag: recursive-query

How to carrying over values for missing dates in time series using last value windows analytical functions in mysql

How to carrying over values for missing dates postcode/indicator_category to create full monthly time series. Im trying to use last_value to carry over values but not able to make it. Is my approach correct? Any help would by highly appreciated. Example given a table: INSERT INTO value to indicator_data table INPUT: postcode month_ts indicator_cat measure sw5 2017-07-01 2 99212.231 sw5

MySQL – select distinct value from two column

I have a table with the following structure: How could I make a select statement on this table, which will return some rows of this table, where in each row, a specific id appears only one, indifferent on which column it is specified? For the above result set, I would like a query that would return: To give another example,

Hierarchical SQL query to Athena

I’m trying to create a query in Athena that solves this problem: I have records that look like this which create a hierarchical structure, like a tree but with indeterminate children. I have more than one root, that is, more than one element that is not children of anyone. I want to get the complete structure for one of them.

Row for each date from start date to end date

What I’m trying to do is take a record that looks like this: and change it to look like this: it can be done in Python but I am not sure if it is possible with SQL Oracle? I am having difficult time making this work. Any help would be appreciated. Thanks Answer connect by level is useful for these