In DuckDB, the strftime()
function is a handy tool for formatting date and timestamp values as strings. It accepts the date/timestamp value and a format string as arguments. The function then returns the date/time in the format provided by the format string.
Tag: functions
Understanding the STRPTIME() Function in DuckDB
DuckDB provides us with a good selection of date/time functions. The strptime()
function is a useful one for times where you need to convert a date string into a valid timestamp value; its sole purpose is to parse strings into timestamps.
In this article, we’ll look at how the strptime()
function works, along with some examples to demonstrate.
A Quick Look at the SUM() Function in DuckDB
One of the more commonly used aggregate functions in SQL databases is the sum()
function, which provides an easy way to calculate the total sum of a numeric column. DuckDB is no exception.
In this article, we’ll explore how the sum()
function works in DuckDB, along with some straightforward examples to demonstrate.
7 Functions that Extract the Day from a Date in DuckDB
When working with dates in DuckDB, extracting specific components like the day is a common task. DuckDB provides a good range of functions that we can use to help us to perform such a task.
This article presents seven different functions we can use to extract the day from a date in DuckDB.
Continue readingA Quick Look at the LIST() Function 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.
How MIN_BY() Works in DuckDB
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.
Continue readingExploring the COUNT() Function 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.
RESERVOIR_QUANTILE() Examples in DuckDB
DuckDB includes a reservoir_quantile()
function that allows us to compute approximate quantiles efficiently. It provides the approximate quantile using reservoir sampling. This function can be handy when working with large datasets where exact quantile computation would be too slow or resource-intensive.
In this article, we will explore how the reservoir_quantile()
function works, along with examples to demonstrate its usage.
Understanding DATE_ADD() in DuckDB
DuckDB has a date_add()
function, which allows us to add a specified time interval to a date or timestamp. This article looks at how the date_add()
function works in DuckDB, including its syntax, usage, and examples.
A Quick Look at DuckDB’s CURRENT_DATE Function
DuckDB is an in-process SQL OLAP database management system designed for analytical workloads. It is known for its speed, efficiency, and ease of use. One of the many functions DuckDB provides is current_date
, which is useful for working with date-related data.
In this article, we’ll look at how the current_date
function works, along with some straightforward examples.