Sometimes we need to subtract a certain time interval from a date when working with DuckDB. We might want to subtract hours, minutes, days, months, or even years.
Below are two methods we can use to subtract one or more years from a date in DuckDB.
Sometimes we need to subtract a certain time interval from a date when working with DuckDB. We might want to subtract hours, minutes, days, months, or even years.
Below are two methods we can use to subtract one or more years from a date in DuckDB.
DuckDB, an in-memory analytical SQL database management system, provides a good selection of functions for data manipulation and analysis. One of the these functions is list().
The list() function enables users to group multiple values into a single list, allowing for more advanced data aggregation and operations.
In this article, we’ll explore how the list() function works, along with some simple examples.
If you’re getting an error that reads “Binder Error: APPROXIMATE QUANTILE can only take parameters in range [0, 1]” in DuckDB, it appears that you’re passing an invalid second argument to the approx_quantile() function.
To fix this issue, make sure the second argument is between 0 and 1.
In DuckDB, we can use functions like strftime() and strptime() to format date or timestamp values. These functions accept a format string that specifies how the date or timestamp should be formatted.
The format string consists of one or more format specifiers. For example, '%d/%m/%Y' is a format string that consists of three format specifiers. The output from that format specifier might look something like 05/09/2050.
DuckDB has a min_by() function that’s similar to the min() function, but with a twist. While the min() function simply returns the minimum value, the min_by() function finds the row with the minimum value in one column and returns the corresponding value from another column at that row.
Here are some examples that demonstrate how it works.
As an Azure Data Studio user, I was surprised when an alert popped up informing me that Azure Data Studio (ADS) is being retired on February 28, 2026. The message included a link to Microsoft’s recent announcement.
Microsoft now recommends we transition to Visual Studio Code (VS Code) instead.
If you find yourself running a lot of ad-hoc queries that start with SELECT * FROM, you might be interested in this interesting feature of DuckDB.
DuckDB allows us to start queries with the FROM clause. When we do this, DuckDB will return all columns without us needing to specify SELECT *.
One common operation you may find yourself doing occasionally in DuckDB is adding intervals to date and/or time values. DuckDB provides us with a couple of easy ways to do this.
Here are two ways to add days to a date in DuckDB.
In SQL databases, COUNT() is a commonly used aggregation function that returns the number of rows in a group. In this article, I run some examples of the COUNT() function in DuckDB. DuckDB is a high-performance analytical database system that’s designed to be fast, reliable, portable, and easy to use.
If you’re getting an error that reads “Binder Error: RESERVOIR_QUANTILE can only take parameters in the range [0, 1]” in DuckDB, it appears that you’re passing an invalid second argument to the reservoir_quantile() function.
To fix this issue, make sure the second argument is between 0 and 1.