---
title: "Troubleshooting SQL questions"
description: "Track down wrong results, variable problems, and syntax errors in SQL questions."
url: "https://www.metabase.com/docs/latest/troubleshooting-guide/sql"
version: "65"
---

# Troubleshooting SQL questions

## Incorrect results

- [Aggregations (counts, sums, etc.) are wrong](https://www.metabase.com/learn/sql/debugging-sql/sql-logic#aggregated-results-counts-sums-etc-are-wrong).
- [Results have duplicated rows](https://www.metabase.com/learn/sql/debugging-sql/sql-logic-duplicated-data).
- [Results are missing rows](https://www.metabase.com/learn/sql/debugging-sql/sql-logic-missing-data).
- [Dates and times are wrong](https://www.metabase.com/docs/latest/troubleshooting-guide/timezones.md).
- [Data isn't up to date](https://www.metabase.com/docs/latest/troubleshooting-guide/sync-fingerprint-scan.md).

## SQL variables and field filters

- [Filter widget doesn't display a dropdown menu of values](https://www.metabase.com/docs/latest/data-modeling/metadata/metadata-editing.md#changing-a-search-box-filter-to-a-dropdown-filter).
- [SQL query contains table aliases](https://www.metabase.com/docs/latest/questions/native-editor/field-filters.md#specifying-the-table-and-field-alias).
- [SQL syntax error: missing `FROM` clause](https://www.metabase.com/docs/latest/questions/native-editor/field-filters.md#field-filters-must-be-connected-to-database-fields-included-in-the-query).
- [I don't know the SQL variable type](https://www.metabase.com/learn/metabase-basics/querying-and-dashboards/sql-in-metabase/sql-variables)

## SQL syntax errors

For some common error messages, see [error messages](https://www.metabase.com/docs/latest/troubleshooting-guide/error-message.md).

## Working with JSON in SQL

Using the `?` operator for working with JSON in SQL may cause queries to fail. On PostgreSQL, you can use `??` instead.

## Are you still stuck?

If you can’t solve your problem using the troubleshooting guides:

- Search or ask the [Metabase community](https://discourse.metabase.com/).
- Search for [known bugs or limitations](https://www.metabase.com/docs/latest/troubleshooting-guide/known-issues.md).
- Hire a [Metabase Expert](https://www.metabase.com/partners).
