How CONCAT_WS() Works in DuckDB

In DuckDB, the CONCAT_WS() function provides an efficient way to join strings with a specified separator. CONCAT_WS() stands for “concatenate with separator”, and many RDBMSs have such a function.

CONCAT_WS() is particularly useful when you need to combine multiple fields or values with a consistent delimiter.

Let’s explore its features and practical applications.

Continue reading

An Overview of the CONCAT() Function in DuckDB

String concatenation is a common operation in database queries, and many database management systems (DBMSs) provide at least one or two ways to concatenate strings. DuckDB is no exception.

One option for concatenating strings in DuckDB is with the CONCAT() function. This function provides a robust and NULL-safe way to combine strings.

Unlike the concatenation operator (||), CONCAT() handles NULL values gracefully and provides a cleaner syntax for combining multiple strings.

In this article, we’ll explore everything from basic usage to advanced techniques and best practices.

Continue reading

Understanding SQLite’s CAST() Expression

SQLite is a widely-used lightweight database engine that powers many mobile, embedded, and desktop applications. One of its key features is its dynamic type system, which allows flexibility in handling data. While this is advantageous in many scenarios, there are cases where developers need precise control over how data is treated or converted between types. This is where SQLite’s CAST() expression comes in.

Continue reading

What ?TABLE? Means When using .help mode in DuckDB

If you’ve ever run .help mode in the DuckDB command line interface (CLI), you may have noticed that it returns information about the .mode command, including its syntax.

You might’ve noticed that there’s a ?TABLE? part in the syntax. What’s this about? Maybe you’ve tried it out and found that it didn’t appear to do anything?

In this article, I’ll explain what the ?TABLE? part is for, and I’ll run an example to demonstrate.

Continue reading

What is NDJSON?

Newline Delimited JSON (NDJSON) is a specialized data format that provides a simple yet powerful way to handle streaming JSON data. While standard JSON is excellent for representing structured data, NDJSON addresses specific use cases where processing large datasets and streaming data is required.

This article takes a quick look at NDJSON and how it differs from regular JSON.

Continue reading

What is JSON?

JavaScript Object Notation, commonly known as JSON, is a lightweight, text-based data interchange format that has become one of the most widely used standards for transmitting data across the internet.

Despite its origins in JavaScript, JSON has evolved into a language-independent format, making it an essential tool for developers working with any programming language or platform.

Continue reading