SQL ASC

Explicitly spells out ascending order — the default, written out loud.

What & Why

ASC sorts smallest-to-largest (or alphabetically A-to-Z for text). It's already the default when no direction is specified — writing it out is purely for clarity.

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 name, spend FROM marketing.campaigns
ORDER BY spend ASC;
RESULT
namespend
Retention Webinar45000.00
Finance Retargeting50000.00
Spring Launch55000.00
Enterprise Search60000.00

The result uses the same Queryflo columns shown in the worked example.

Now You Try

Practice this concept

Marketing wants campaigns sorted from the lowest spend to the highest spend.

Available schema
marketing

Prefix tables with marketing.table_name.

namespend
marketing.campaigns
ColumnType
idinteger
nametext
channeltext
spendnumeric
start_datedate
end_datedate
statustext
target_segmenttext
legacy_idtext
query.sql
Beginner business practice

Sign up free to try it on a real business scenario