> For the complete documentation index, see [llms.txt](https://docs.daita.ch/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.daita.ch/usage/relational/functions/conditional/coalesce.md).

# COALESCE

```typescript
const stats = await client.select({
   select: {
       height: coalesce([field(Moutain, 'height'), field(Moutain, 'backupHeight')]),
       name: field(Mountain, 'name'),
   }
   from: table(Mountain),
});
// sql: SELECT COALESCE("Mountain"."height", "Mountain"."backupHeight"), "Mountain"."name"
//      FROM "Mountain"
//
// const stats: { height: number, name: string }[]
```
