What does selectRowList take and what is its result?
If selectRow takes several columns from one row, then selectRowList takes several rows and several columns.
Several rows list + several columns row = rowlist
| id | field_1 | field_2 |
|---|---|---|
| 0 | 100 | a |
| 1 | 200 | b |
| 2 | 300 | c |
First, you refer to the row, and then to the column. If we want to take the value 200 from this rowlist, then:
=: $rowlist[1][field_1]
rowlist
How do I refer to a specific row and what will be the result?
If we refer only to the rowlist string, we get row:
| id | field_1 | field_2 |
|---|---|---|
| 0 | 100 | a |
| 1 | 200 | b |
| 2 | 300 | c |
=: if(condition: $row[field_1] = 200; then: true; else: false)
row: $rowlist[1]
rowlist: "..."
// Result true
How do I take a column from a list of rows?
If we want to get a column, we need to use [[]].
The result of such an access will be a list of all values in the column:
| id | field_1 | field_2 |
|---|---|---|
| 0 | 100 | a |
| 1 | 200 | b |
| 2 | 300 | c |
=: $rowlist[[field_2]]
rowlist: "..."
// Result ["a","b","c"]