Skip to content

Repeat Rows Between Date Values in Redshift

I have a table: id | start_date | end_date —————————- 01 | 2016-02-19 | 2017-03-02 02 | 2017-06-19 | 2018-09-11 03 | 2015-03-19 | 2018-05-02 04 | 2018-02-19 | 2018-01-05 05 | 2014-…

Count sum of two columns

I am trying to count the sum of 2 columns from a subset of results, so far I have put this together SELECT COUNT(*) FROM table_name WHERE column_1 + column_2 >= 3 IN (SELECT id …

Rounding time untill in SQL

I have a table with timestamp that I want to round off at 15 min. interval. I can round off using the below Query but it rounds off both 11:58 and 12:02 to 12:00 which is not what I want. I would like …

Select data from date range in DB2 SQL

I have a trouble trying get a data in DB2 SQL. I have a table Name StProdMoves and it holds data like this ProdName | Status | Brand | Type | Date(Numeric) ———-+———+——-+——-+—–…