

# FROM-first syntax

You can start a query with the `FROM` clause and put the `SELECT` list after it. The other clauses follow in their usual order. If you leave out the `SELECT` list, the query returns every column, as with `SELECT *`.

A FROM-first query can also appear as a subquery.

## Syntax
<a name="athena-duckdb-statement-select-from-first-syntax"></a>

```sql
FROM {{from_item}} [, ...] [ SELECT {{select_list}} ]
    [ WHERE {{condition}} ] [ GROUP BY {{grouping_element}}
    [, ...] ] [ ORDER BY {{expression}} [, ...] ]
    [ LIMIT {{count}} ]
```

## Examples
<a name="athena-duckdb-statement-select-from-first-examples"></a>

For a description of the sample tables that the examples on this page use, see [SELECT statement in DuckDB](duckdb-statement-select.md).

The following SQL query puts `FROM` first and the select list second.

```sql
FROM sales_db.sales_parquet
SELECT customer, amount
WHERE region = 'west'
ORDER BY customer
```

The query returns the following results.


| customer | amount | 
| --- | --- | 
| `bob` | `75.00` | 
| `erin` | `18.75` | 

The following SQL query leaves out the select list, so it returns every column of the Iceberg table.

```sql
FROM sales_db.orders_iceberg ORDER BY order_id
```

The query returns the following results.


| order\_id | customer | region | amount | order\_date | 
| --- | --- | --- | --- | --- | 
| `1` | `alice` | `east` | `120.50` | `2026-10-01` | 
| `2` | `bob` | `west` | `75.00` | `2026-10-01` | 
| `3` | `carol` | `east` | `42.25` | `2026-10-02` | 

The following SQL query uses a FROM-first query without a select list as a subquery.

```sql
SELECT count(*) AS east_orders
FROM (FROM sales_db.sales_parquet WHERE region = 'east')
```

The query returns the following result.


| east\_orders | 
| --- | 
| `3` | 