Skip to content
Advertisement

Tag: calendar

Get List of Last 15 Days Date in SQL

Could SQL get list of date of last 15 days date in a single query? We can get today date with select current_date() We also can get last 15 days date with select date_add(current_date(), -15) But how to show the list of last 15 days date? For example the output is Answer In Hive or Spark-SQL: Result: See also this

PostgreSQL count of each status per day

I have the following table: I also have a table with every calendar day from 2019-11-01 to 2019-12-31. I need to find out how many occurrences of each status exist per calendar day for the time span listed above. If a status is Opened on 2019-12-14 and Pending on 2019-12-17, I need to count that it was Opened for every

Advertisement