# Binder Error: DuckDB could not plan the query

> DuckDB parsed the query but couldn't plan it: a missing column, an alias out of scope, or types that don't fit the function. A missing table raises Catalog Error instead.

Source: https://sqlly.app/errors/duckdb/binder-error
Last updated: 2026-11-30
License: Text and data [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) (credit SQLly, sqlly.app); code and SQL snippets [MIT](https://opensource.org/license/mit). [Details](https://sqlly.app/license).
Note: Quoted error message text belongs to its database vendor.

- Exception: `Binder Error`
- Category: Binder Error

Error message:

```text
Binder Error: Could not choose a best candidate function for the function call "+(INTEGER_LITERAL, STRING_LITERAL)". In order to select one, please add explicit type casts.
```

## What it means

`Binder Error` means the parser accepted the SQL but the binder could not resolve it against the catalog and the types. This is the class for the most common day-to-day mistakes: a column or table that does not exist, a function called with argument types that have no overload, or a struct key that is not there. DuckDB binds each statement before running it, so a bind error means that statement did not run. Statements earlier in the same script have already run.

The message says exactly which name, column or function signature failed. When the same SQL works elsewhere, compare the schema and the DuckDB version, because different builds ship different function overloads and extensions.

## Common causes

- A column name that does not exist in the FROM clause, or a table alias used outside its scope.
- A function called with argument types that match no overload, such as `1 + 'a'` or `avg(text_column)`.
- A struct or union key that is not present, for example `{'a': 1}.b`.
- A call to a function from an extension that is not loaded. DuckDB reports that as Catalog Error, not Binder Error.

## How to fix it

1. Check the names the message mentions against the actual schema before changing the SQL:

   ```sql
   DESCRIBE my_table;
   SELECT table_schema, table_name, column_name
   FROM information_schema.columns
   WHERE table_name = 'my_table';
   ```
2. Add explicit casts when the binder cannot pick an overload, so the operation is unambiguous:

   ```sql
   SELECT int_col + CAST(text_col AS INTEGER) FROM my_table;
   ```
3. List the functions that do exist when a name fails. Some names are aliases with the same signatures, such as `group_concat` and `string_agg`:

   ```sql
   SELECT function_name, parameter_types
   FROM duckdb_functions()
   WHERE function_name ILIKE '%agg%';
   ```
4. Load the extension a function belongs to when the name is unknown on this connection:

   ```sql
   LOAD httpfs;
   ```

## Reproduce it safely

```sql
SELECT 1 + 'a';   -- Binder Error: Could not choose a best candidate function for the function call "+(INTEGER_LITERAL, STRING_LITERAL)". In order to select one, please add explicit type casts.
```

## Questions

### Binder Error or Catalog Error: which one means a missing table?

A table that does not exist gives Catalog Error. A table that exists but lacks the column you named gives Binder Error.

### Why does the same query work in another tool?

The other tool may run a different DuckDB version or have extensions loaded. Check `version()` and `duckdb_extensions()` on both connections.

## Related errors

- [`Binder Error`](https://sqlly.app/errors/duckdb/column-not-exist): The column is not in the FROM clause
- [`Conversion Error`](https://sqlly.app/errors/duckdb/conversion-could-not-convert): The value cannot be cast to the target type
- [`Catalog Error`](https://sqlly.app/errors/duckdb/catalog-table-not-exist): The table does not exist in this database
- [`Parser Error`](https://sqlly.app/errors/duckdb/parser-syntax-error): The SQL does not parse
- [`SQLITE_ERROR`](https://sqlly.app/errors/sqlite/sqlite-error): SQLite: SQL logic error
- [`42703`](https://sqlly.app/errors/postgresql/42703): PostgreSQL: column does not exist

The code and message text are from the [DuckDB documentation](https://duckdb.org/docs/).
