The following table outlines the inbuilt mathematical functions available in SQLite.
Continue readingTag: functions
A Quick Overview of DuckDB’s LAST() Function
DuckDB is an in-process SQL OLAP database management system designed for analytical workloads. Among its many functions is one called last()
. This function returns the last value in a column.
Let’s take a look at the last()
function in DuckDB.
The Difference Between AGE() and DATE_DIFF() in DuckDB
Both AGE()
and DATE_DIFF()
are DuckDB functions used to calculate time differences, but they serve distinct purposes and exhibit different behaviors that are important to understand when working with temporal data.
This article explores the difference between these two functions.
Continue readingUsing MAKE_DATE() to Construct a Date in DuckDB
In DuckDB, the make_date()
function enables us to create date values from individual year, month, and day components. This function is particularly useful when working with data that stores date components separately or when constructing date values programmatically.
MAX_BY() Examples in DuckDB
DuckDB has a max_by()
function that finds the row with the maximum value in one column and returns the corresponding value from another column at that row.
Below are some examples that demonstrate how it works.
Continue readingExploring the FIRST() Function in DuckDB
One of the aggregate functions available in DuckDB is the FIRST()
function, which returns the first value from each group in a query.
Let’s take a look at some examples of using the FIRST()
function in DuckDB
Formatting Dates with STRFTIME() in DuckDB
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.
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 reading