---
title: Calculated columns
project: Tables
version: 7.0
section: guides
language: en
translation: missing
license: Total.js Enterprise
url: https://totaljs.es/docs/es/tables/7-0/guides/sql-columns/
updated: 2026-11-20T06:39:57.622Z
---

# Calculated columns

> Show a value calculated by PostgreSQL from other columns with the SQL column type.

A column of the type **SQL** shows a value that PostgreSQL calculates from the other columns of the record. It is read-only and is not stored; it is calculated each time the records are read.

## Add a calculated column

**1.** Open the settings of the table and click **Add** in the **Columns** tab.

**2.** Choose the type **SQL**.

**3.** Enter the **Name**, for example `Stock value`.

**4.** In **SQL expression**, write the calculation. Refer to the other columns with the `col.` alias and their IDs:

```sql
col.x02 * col.x03
```

**5.** Click **SUBMIT** in both forms.

In a *Products* table where `x02` is the price and `x03` is the number in stock, this column shows the value of the stock of each product.

Any expression that PostgreSQL accepts in a `SELECT` works, for example `UPPER(col.x01)` or `COALESCE(col.x04, 0) * 1.21`.
