Learn SQL/Beginner/SQL Foundations/SQL SELECT All Columns (*)

SQL SELECT All Columns (*)

The asterisk means every column — quick to write, but worth using deliberately, not by default.

What & Why

SELECT * returns every column in the table, without naming any of them individually. It's the fastest way to peek at a table's full shape while exploring — but naming exact columns is usually the better habit once you know what you actually need.

See How It Works

idnamechannelspendstart_dateend_datestatustarget_segment
1Spring Launchgoogle_ads55000.002024-01-152024-03-31activesmb
2Retention Webinaremail45000.002024-02-102024-04-15activeenterprise
3Finance Retargetinglinkedin50000.002024-03-122024-05-31activeenterprise
4Enterprise Searchgoogle_ads60000.002024-04-012024-06-30activeenterprise
EXAMPLE QUERY
SELECT *
FROM marketing.campaigns;
RESULT — every marketing.campaigns column
idnamechannelspendstart_dateend_datestatustarget_segment
1Spring Launchgoogle_ads55000.002024-01-152024-03-31activesmb
2Retention Webinaremail45000.002024-02-102024-04-15activeenterprise
3Finance Retargetinglinkedin50000.002024-03-122024-05-31activeenterprise
4Enterprise Searchgoogle_ads60000.002024-04-012024-06-30activeenterprise

SELECT * returns all eight columns in marketing.campaigns for every row shown here.

Now You Try

Practice this concept

Product is exploring its feature table. Return every available column for the first five feature records.

Available schema
product

Prefix tables with product.table_name.

idnamedescriptionteamreleased_atdeprecated_atinternal_priority
product.features
ColumnType
idinteger
nametext
descriptiontext
teamtext
released_attimestamp with time zone
deprecated_attimestamp with time zone
internal_priorityinteger
query.sql
Beginner business practice

Sign up free to try it on a real business scenario