skip to today's puzzle

<> means 'is not this'

Starting table: orders

Starting orders data before the example query
idstatus
101completed
102cancelled
103ready
104NULL

<> means 'is not equal to': rows with that value are left out, everything else appears in your results. <> is the ANSI standard spelling; != isn't in the standard, but nearly every database accepts it too. Heads up: rows with a blank cell (NULL) are skipped too, since SQL can't compare what isn't recorded.

A tiny example

In plain English: Show me the id and status of orders whose status is not cancelled.

SELECT id, status
FROM orders
WHERE status <> 'cancelled';

Query result

idstatus
101completed
103ready

101 (completed) and 103 (ready) appear in your results. 102 is cancelled, so it is excluded. 104 has a NULL status, so SQL cannot confirm it is not cancelled and excludes it too.

Related SQL lessons

Practice <> step by step

The Foundations Track has beginner puzzles built around this idea. Tap tiles, see real results. No terminal, no setup.

practice this in the course

Ready for a break?

A fresh, bite-sized SQL puzzle waits every morning. Tap tiles, see real results. No terminal, no setup, no timers.

Try today's free SQL puzzle