# SQL Query Return all values equal to specific value

**URL:** <https://forum.inductiveautomation.com/t/sql-query-return-all-values-equal-to-specific-value/62270>\
**Category:** Ignition\
**Tags:** perspective, ignition81\
**Created:** [July 25, 2022, 3:39pm UTC](https://forum.inductiveautomation.com/t/sql-query-return-all-values-equal-to-specific-value/62270 "2022-07-25T15:39:13Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![csilk](https://avatars.discourse-cdn.com/v4/letter/c/9e8a1a/32.png) [@csilk](https://forum.inductiveautomation.com/u/csilk)\
**Post date:** [July 25, 2022, 3:39pm UTC](https://forum.inductiveautomation.com/t/sql-query-return-all-values-equal-to-specific-value/62270/1 "2022-07-25T15:39:13Z")

</div>

I have the following database:  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/b/1/b1471a62f8c4ebec9962dd49c2afad046444d4b9.png)

I have a button that I has the following script:

```auto
checkReports = system.db.runScalarQuery("SELECT Client FROM Tracker WHERE SendReminder IN ('X')")
self.getSibling("TextField").props.text = checkReports

```

The problem is, my SQL query is only returning the first client “A” in the textbox, and not the rest of the clients. How can I return the name of each client that has an X in their “SendReminder” column? So in this case, it would return “A, B, E”

Thank you

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [July 25, 2022, 3:40pm UTC](https://forum.inductiveautomation.com/t/sql-query-return-all-values-equal-to-specific-value/62270/2 "2022-07-25T15:40:48Z")

</div>

Use `system.db.runQuery`, not `system.db.runScalarQuery`.

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [July 25, 2022, 4:15pm UTC](https://forum.inductiveautomation.com/t/sql-query-return-all-values-equal-to-specific-value/62270/3 "2022-07-25T16:15:47Z")

</div>

`runScalerQuery` returns only one row.  
Named queries configured as _scaler_ will also only return one row.

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [July 25, 2022, 4:25pm UTC](https://forum.inductiveautomation.com/t/sql-query-return-all-values-equal-to-specific-value/62270/4 "2022-07-25T16:25:06Z")

</div>

Not just one row, first row and first column, i.e. a scalar value.
