Arithmetic addition operator +

Last updated: 2026-11-04

Arithmetic addition operator +

The addition operator + sums two numeric operands and is the most basic arithmetic operation in SQL. It works on integer, numeric, bigint, money and other numeric types, and the result is NULL whenever either operand is NULL. There is no string addition in PostgreSQL; use the || operator for text concatenation.

Kindoperator
Example LanguageSQL

📝 Syntax

a + b

Precedence, highest to lowest: `.`/`::`/`[]` > unary `+ -` > `^` > `* / %` > binary `+ -` > all other operators (including `||`) > `BETWEEN`/`IN`/`LIKE` > comparison `< > = <= >= <>` > `IS NULL`/`IS TRUE` > `NOT` > `AND` > `OR`. Binary `+`/`-` at the same level are left-associative, so `10 - 3 - 2` is 5.

⚙️ Parameters

aLeft operand, any numeric type; if NULL the whole expression evaluates to NULL.
bRight operand, any numeric type; if NULL the whole expression evaluates to NULL.

Returns:A numeric type matching the operands; NULL if either operand is NULL.

▶ Example

Runs real PostgreSQL 18 right in your browser (PGlite WASM, nothing to install). Press ▶ Run and the result appears in the panel below.

Output:

SELECT id, a + b AS sum FROM t_plus ORDER BY id
id |  sum
---+-----
 1 |   13
 2 | NULL
 3 |    1
(3 rows)

SELECT a + b IS NULL AS null_is_absent FROM t_plus WHERE id = 2
null_is_absent
--------------
true          
(1 row)

📌 Key Points

More case studies coming soon.

📚 Related Reference

❓ FAQ

QWhy is 10 + NULL not 10?
ANULL means "unknown", not 0. Adding an unknown value to 10 is still unknown, so the result is NULL.
Web-Tutorial.com

Web-Tutorial Tech Team

A team of developers maintaining programming tutorials. Each tutorial is written and reviewed by developers with expertise in that field. We work to keep our content accurate and reliable — if you spot an issue, please let us know.

Content reviewed by MOTO · Found an error? Report it

100%

🙏 帮我们做得更好

我们是刚上线的编程教程站,几个人的小团队,精力有限。页面虽经检查,难免还有疏漏——链接失效、排版错乱、内容有误、语言生硬……

如果您发现了,麻烦告诉我们,我们会在收到反馈后第一时间进行修复,再次感谢您的光临 🙏