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.
Continue readingOne 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.
Continue readingIf 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.
Continue readingSQLite is a lightweight, serverless SQL database engine commonly used for developing mobile applications, web applications, and embedded systems. Among its various functionalities, SQLite allows developers to create indexes, including unique indexes, to enhance data retrieval speed and enforce constraints on data integrity.
A unique index ensures that all values in a specific column, or combination of columns, are distinct, preventing duplicate entries.
In this guide, we’ll walk through the basics of unique indexes in SQLite, explore when and why to use them, and provide examples of how to create them.
Continue readingIf you’re getting an error that reads something like “Binder Error: Cannot mix values of type …etc” when using the COALESCE()
function in DuckDB, it’s probably because you’re using arguments with incompatible types.
To fix this issue, try using CAST()
or TRY_CAST()
to ensure that all arguments are compatible. Alternatively, make sure the arguments to COALESCE()
are of the same type (or at least, compatible types).
In SQL Server, Common Table Expressions (CTEs) are often used for readability and simplifying complex queries. While CTEs are most commonly used when running a SELECT
query, we can also use CTEs to perform updates with the UPDATE
statement. This can be useful when we need to reference the same set of data multiple times or want to update records conditionally.
This article demonstrates how to output your DuckDB query results in LaTeX table format, which can be useful when preparing academic papers, technical documents, or any content that needs to be typeset using LaTeX.
Continue readingDuckDB’s CLI allows you to output query results in different formats, including NDJSON (Newline Delimited JSON).
NDJSON is similar to JSON, except that with NDJSON, each line contains its own self-contained JSON document.
This article shows you how to check your current output mode, and then change it to NDJSON.
Continue readingString concatenation is a common operation when running database queries. It simply involves joining two strings together, end to end. DuckDB provides multiple methods for combining strings, each with its own use cases and advantages.
This article explores the various ways to concatenate strings in DuckDB.
Continue readingIf you’re getting an error that reads something like “No function matches the given name and argument types ‘bool_and(INTEGER)’” in DuckDB, it’s probably because you’re passing a non-boolean value to the bool_and()
function.
The bool_and()
function is for use against boolean expressions, so to fix this issue, be sure that the argument you pass to the function is a boolean expression.
DuckDB is a high-performance, in-process SQL database management system that supports various modes of operation, including the ability to create an in-memory database. An in-memory database stores all data in RAM, ensuring fast access and excellent performance.
This article explores how to create an in-memory database in DuckDB.
Continue reading