# sqlColAlias {#sqlcolalias}

**Parent topic:**[Functions](../../Functions/category.md)

## Syntax {#syntax}

`sqlColAlias(colDefs, [colNames])`

## Arguments {#arguments}

**colDefs** is metacode.

**colNames** \(optional\) is a string indicating an alias name.

## Details {#details}

Use metacode and an optional alias name to define a column. It is often used to name calculated columns.

## Examples {#examples}

```
sqlColAlias(<x>, `y);
// output: < x as y >

sqlColAlias(<avg(PRC)>, `avgPRC);
// output: < avg(PRC) as avgPRC >

sqlColAlias(<avg(PRC)>);
// output: < avg(PRC) as avg_PRC >
```

