---
title: "db:select — Select rows"
description: "iXML command db:select: Select rows."
canonical_url: "https://www.zeyos.com/ixml/ref/db-select"
markdown_url: "https://www.zeyos.com/ai/guide/ixml/ref/db-select.md"
section: "ixml-reference"
authority: "reference"
language: "en"
source_repository: "https://cloud.zeyos.com/__doc/ixmldoc.xml"
source_sha256: "a23f04e6a98628ca3c273c3b8dd2c33c034cfda3e0f00478d8793074fd2f70dd"
---

# db:select — Select rows

DB:SELECT generates and executes a SQL select statement and retrieves the accordant result set from the database.

### Attributes
| Name | Type | Default | Description |
| ---- | ---- | ------- | ----------- |
| var | var |  | Result variable name for generated SQL statement |
| var_count | var |  | Result variable name for number of results |
| var_result | var |  | Result variable name for retrieved result set |
| type | type | num | Result set type |
| distinct | bool |  | Distinct result set |
| offset | int |  | Offset |
| limit | int | (no limit) | Limit |

#### Possible values
Possible values for `type`:
- num — Multidimensional array with consecutive numeric keys
- assoc — Multidimensional array with field names as keys
- list — Unidimensional list
- av — Unidimensional array with associated attribute and value pairs
- single — Single array item with consecutive numeric keys
- self — Single array item with field names as keys
- value — Single value


### Children
- db:fields (occurrence: single) — Fields
- db:table (occurrence: single) — Table
- db:join (occurrence: single) — Join clause
- db:groupby (occurrence: single) — Group by clause
- db:having (occurrence: single) — Having condition
- db:orderby (occurrence: single) — Order by clause

### Parents
- db:connection

### Result
- binding: var; type: string
- binding: var_count; type: int; predicate: no-result-propagation
- binding: var_result; type: array; predicate: no-result-propagation
