# SERIAL()

## Function description

The SERIAL() function is used to serialize a connection string, combining a single or multiple columns/values into a binary format, with the return type `VARCHAR`. It is similar to [`CONCAT()`](https://omnifabric.cloudsigma.com/docs/reference/sql/Functions-and-Operators/String/concat.html.md), but in `CONCAT()`, the type information of the value cannot be captured. Generally used with the [`SERIAL_EXTRACT()`](https://omnifabric.cloudsigma.com/docs/reference/sql/Functions-and-Operators/Other/serial_extract.html.md) function.

If any of the parameters in `SERIAL()` is NULL, NULL is returned. To process NULL values, use [`SERIAL_FULL()`](https://omnifabric.cloudsigma.com/docs/reference/sql/Operators/operators/cast-functions-and-operators/serial_full.html.md).

## Function Syntax

```text
> SERIAL(para)
```

## Parameter definition

| Parameters | Description |
| ---- | ---- |
| para | Column/value to serialize |

## Example

```text
create table t1(a varchar(3), b int);
insert into t1 values("ABC",1);
insert into t1 values("DEF",NULL);

mysql> select serial(a,b) from t1;--The query returns the result of serialization of column a and column b. When there is a NULL value, the output is NULL
+--------------+
| serial(a, b) |
+--------------+
| FABC :       |
| NULL         |
+--------------+
2 rows in set (0.00 sec)

mysql> select serial(a,'hello') from t1;--Query returns the result of a column and value hello combination serialization
+------------------+
| serial(a, hello) |
+------------------+
| FABC Fhello      |
| FDEF Fhello      |
+------------------+
2 rows in set (0.00 sec)
```
