> For the complete documentation index, see [llms.txt](https://mariadb.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://mariadb.com/docs/server/reference/sql-statements/data-manipulation/selecting-data/set-operations/minus.md).

# MINUS

{% hint style="info" %}
`MINUS` is available starting from MariaDB 10.6.1.
{% endhint %}

`MINUS` is a synonym for [EXCEPT](/docs/server/reference/sql-statements/data-manipulation/selecting-data/set-operations/except.md) when [SQL\_MODE=ORACLE](/docs/release-notes/community-server/about/compatibility-and-differences/sql_modeoracle.md) is set.

```sql
CREATE TABLE seqs (i INT);
INSERT INTO seqs VALUES (1),(2),(2),(3),(3),(4),(5),(6);

SET SQL_MODE='ORACLE';

SELECT i FROM seqs WHERE i <= 3 MINUS SELECT i FROM seqs WHERE i>=3;
+------+
| i    |
+------+
|    1 |
|    2 |
+------+
```

<sub>*This page is licensed: CC BY-SA / Gnu FDL*</sub>

{% @marketo/form formId="4316" %}
