LogoLogo
LoginGo to website
English
English
  • Getting started
    • First steps
    • Login
  • Navigation
    • Sidebar
    • Path navigation
    • Home
    • Resources
  • Account management
    • Account
    • Profile
    • Security and access
    • Personal Access Key (PAK)
    • Notifications
  • Organization management
    • General
    • Members
    • Groups
    • Tags
    • Connect
  • Workspaces
  • Solutions
  • Datasets
    • Create dataset
    • Explore dataset
    • Upload data
    • Export data
    • Manage dataset
  • Insights
    • Create insight
    • Aggregation
    • Filters
    • SQL Editor
    • Visualization
      • Table chart
      • Line chart
      • Bar chart
      • Pie chart
      • Single number
    • Joins
      • Basics
      • Joins in insights
    • Manage insights
  • Reports (soon)
  • Forms (soon)
  • Documentation
  • Roles and permissions
    • Roles
    • Permissions
    • Permission matrix
  • Security and data protection
    • Trust Center
    • Security measures
    • Data protection
    • Hosting
  • Help and support
Bereitgestellt von GitBook
Auf dieser Seite
  • Opening the SQL editor.
  • Selecting a dataset.
  • Writing a custom query.
  • Exploring the dataset schema.
  • Common SQL clauses.
  • Query validation.
  • Running the query.
  • Switching back to visual mode.

War das hilfreich?

Als PDF exportieren
  1. Insights

SQL Editor

The SQL editor lets you write your own query to explore datasets.

VorherigeFiltersNächsteVisualization

Zuletzt aktualisiert vor 29 Tagen

War das hilfreich?

It’s useful if you want more control than the visual builder offers. You can select columns, add filters, and group or sort results exactly how you want. The editor uses .

To run a query, you must first select a dataset and always end your query with a LIMIT. The maximum row number for queries is 1000.

Opening the SQL editor.

You can switch to SQL mode from any insight:

  • Go to the Data tab.

  • Click the SQL button next to No-code.

This opens a text editor where you can write your SQL query.

Selecting a dataset.

You always need to define which dataset the query should run on.

  • Click the dropdown labeled Available datasets.

  • Copy the dataset ID using the Copy button.

  • Paste it into your SQL code.

Example:

select *
from '{{ds_abc123xy456}}' as "Example Dataset"
limit 1000

Important: Always add LIMIT at the end of your query. The query won’t run without it. 1000 is the maximum number of rows for the query.

Writing a custom query.

Once the dataset is selected, you can write any valid DuckDB SQL.

Example: Select and count.

select department, count(*) as total
from '{{ds_abc123xy456}}'
group by department
order by total desc
limit 1000

This example counts how many rows exist for each department and sorts them from high to low.

Exploring the dataset schema.

Below the editor, you’ll see a list of columns for the selected dataset. Each one shows:

  • The column name

  • The data type (like VARCHAR, DATE, DOUBLE, etc.)

Use these to help write valid queries without guessing column names.

Example types:

Column name
Type
Meaning

Name

VARCHAR

Text values

Start date

DATE

Date for filtering

Age

BIGINT

Whole number

Full-time equivalent

DOUBLE

Decimal number

Common SQL clauses.

You can use all standard DuckDB clauses. Here’s a quick overview:

Clause
What it does

select

Pick which columns to show

from

Define the dataset

where

Filter rows (e.g. where age > 30)

group by

Summarize data (e.g. totals per category)

order by

Sort rows (e.g. order by name asc)

limit

Always required, limits number of rows

Query validation.

All SQL queries are validated before they are run. The system checks your query to make sure it is safe and follows platform rules.

Operations that could change, delete, or harm data — like DROP, DELETE, UPDATE, or creating new tables — are not allowed. If the system detects something invalid or unsafe, the query won’t run.

This ensures that only safe and read-only operations are possible in the editor.

Running the query.

Click the Run button to execute your query. Results appear in the table on the left.

If nothing shows up:

  • Check for typos in column names.

  • Make sure the dataset ID is correct.

  • Confirm you added limit 1000.

If still empty, your query might return no rows based on the filters.

Switching back to visual mode.

Want to use the builder again?

  • Click No-code next to SQL.

  • This resets your query and returns to the drag-and-drop interface.

Note: You will lose your current SQL query if you switch.

DuckDB SQL syntax