Filter and combine data with SQL

Copy the result of one SELECT instead of a whole table.

Last updated November 24, 2026

A table from SQL copies the result of one SELECT as a table in the destination. Use it for a join, only some rows, only some columns, or computed columns. It only reads the source.

Add a table from SQL

  1. On Tables & mapping, click + Table from SQL above the table list.
  2. In Table in the destination, type the name of the table, for example orders_2025.
  3. In SELECT, in the source's own SQL, enter a query using the SQL syntax of your source database. In DBConvert Studio, you can also describe the result in words and let the assistant write the query.
  4. Click Add to job.

Use the value format expected by the source database. For example, enclose text in single quotes ('Germany'). For dates in MS Access, use # signs, for example #2025-01-01#.

Tables & mapping with an empty New table from SQL pane: the description field, the table name, the SELECT and Add to job

Add to job checks the SELECT on the source first. If the source rejects it, its own message appears under the editor and nothing is added. Edit the SELECT and try again.

In DBConvert Studio, you can also click Fix with AI to have the assistant correct the query.

The table appears in the list with an SQL mark. It is ticked like any table and copied with the others. In only selected mode, a table from SQL that is not ticked is not copied.

To copy only the first rows, put the limit in the SELECT, in the source's own words: LIMIT, TOP, FETCH FIRST or FIRST.

Copy only matching rows

To copy only customers in Germany, name the destination table customers_germany and enter:

SELECT *
FROM customers
WHERE country = 'Germany'

Click Add to job. Change the table name, column and value to match the source. Write the condition in the source database's SQL.

The source table customers and the SQL table customers_germany appear separately. To copy only the filtered rows, untick customers and leave customers_germany ticked. If both are ticked, the job also copies the source table in full. Review the destination names and existing-table options before starting.

If you give the SQL table the name of a source table, it takes that table's place in the job. Review the SQL-marked entry before starting.

Describe it in words

DBConvert Studio only. Type what you want in the field above the SELECT, for example customers from Germany with their order count, and click Generate. The assistant writes the SELECT and the app checks it. It needs an agent picked in Settings, Assistant.

Table from SQL:

  • The SELECT and the name fill the fields. Undo puts back what they held before.
  • With a SELECT already in the editor, describe the change, for example only customers from Germany.
  • Nothing is saved until you click Add to job. The words you typed are saved with the table and shown again when you open it.
  • Show sample rows to the assistant lets it see up to 20 rows of the result. Where it is on or off by default: What it sees.

A SELECT already in the editor with the field open for a change:

Combine data from several tables

In this video, the assistant writes a SELECT for albums with the artist name and number of tracks. The query combines the album, artist and track tables. The result is added to the job and copied to PostgreSQL.

Watch on YouTube (1:02)

The check

The check runs after Add to job or Save, and whenever you open a saved table from SQL. It reads the source without changing it and shows:

  • the number of columns;
  • every column with its type in the source and in the destination;
  • the first rows of the result.

A saved table from SQL: the number of columns, each column with its source and destination type, and the Primary key tick boxes

The number of rows is counted only when you click Count rows. When you edit the SELECT, the card is marked stale until the next check.

When the source is slow

Saving a slow SELECT:

With a condition on a column that has no index, the source can read most of the table before it finds the first rows. The window then shows Waiting for the source: N s, counting seconds. Cancel stops the query on the source, not only the wait in the window.

Primary key

A primary key is optional. Tick the columns in the Primary key column of the check. They must be unique and never NULL. This is checked when you save, not again before each run. A key that broke after saving is named when the run reaches it, with the table, the key and how many rows.

Synchronization matches rows by key. See Give tables a primary key.

Where it works

  • Conversion jobs only. A synchronization job refuses it.
  • Any SQL source except Excel and FoxPro. There the pane shows the reason instead of the fields.
  • Exactly one SELECT (or WITH ... SELECT). Anything else is refused before it reaches the source.
  • It runs read-only. SQL Server and DB2 have no read-only session, so only this text check protects the source there: connect with a login that can only read.

Change or delete it

The table list with GermanyInvoices marked SQL; the table is open at its SQL

Click the table in the list. It opens at its SQL, with the tabs SQL, Columns and Indexes. A table from SQL has no foreign keys. Edit the name or the SELECT and click Save. The line above the fields says Changed, not saved or Saved in the job.

  • The bin icon deletes the table from the job after asking. The source is not touched.
  • Leaving with unsaved changes asks Save, Discard or Cancel.

The plan and the progress show the rows of a table from SQL as unknown, because the source has no count for a query.

Row filters from earlier versions

There is no Filter rows button and no condition on a single table any more. A table from SQL does the same.

A job that has an old row filter, from an earlier version, including DBConvert Studio 4.x, is converted when you open it. For a filtered table T:

  • It becomes a table from SQL named T, in the place of the table: SELECT * FROM T WHERE ..., with the old limit in the source's own words.
  • Its key is the primary key of T, or none if T has none.
  • T stays selected and is copied into T.

Delete the table from SQL and T is copied whole again.

A filter that cannot be converted, such as one in a Sync job or on an unreachable source, is not ignored and the table is never copied whole. The job is refused with <table>: row filter is no longer supported: add it as a query. Add the table from SQL yourself.

A table from SQL also cuts transfer time on large tables. See Speeding up large transfers.