# SQL Where Statement

**URL:** <https://forums.losant.com/t/sql-where-statement/3886>\
**Category:** Help\
**Tags:** sql-node\
**Created:** [June 27, 2021, 12:16pm UTC](https://forums.losant.com/t/sql-where-statement/3886 "2021-06-27T12:16:41Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![David\_MacKenzie](https://avatars.discourse-cdn.com/v4/letter/d/f04885/32.png) [@David\_MacKenzie](https://forums.losant.com/u/David_MacKenzie)\
**Post date:** [June 27, 2021, 12:16pm UTC](https://forums.losant.com/t/sql-where-statement/3886/1 "2021-06-27T12:16:41Z")

</div>

OK, I hope this is an obvious one. Can I use a WHERE statement in the SQL node? ALL of your examples are of the format “select \* from table” without an example of some like “select \* from table where UserID = ‘smith’”. I have tried multiple variations of syntax. What am I missing here? I am scheduled to visit your office on Tuesday, so you can hit me with the “stupid stick” if you like…

---

<div class="post-metadata">

**Author:** ![Heath](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/heath/32/3036_2.png) [@Heath](https://forums.losant.com/u/Heath)\
**Post date:** [June 28, 2021, 1:27pm UTC](https://forums.losant.com/t/sql-where-statement/3886/3 "2021-06-28T13:27:34Z")

</div>

Hey @David_MacKenzie,

Are you getting an error when you attempt the `where` statement? If so, could you send me a screenshot of that error?

Would you also be able to share a screenshot of your SQL Node configuration?

Thanks,  
Heath

---

<div class="post-metadata">

**Author:** ![David\_MacKenzie](https://avatars.discourse-cdn.com/v4/letter/d/f04885/32.png) [@David\_MacKenzie](https://forums.losant.com/u/David_MacKenzie)\
**Post date:** [June 28, 2021, 1:47pm UTC](https://forums.losant.com/t/sql-where-statement/3886/4 "2021-06-28T13:47:36Z")

</div>

My query is SELECT \* FROM RanpakValidationSN where SerialNumber = “R50”

· “errors”:

“SELECT \* FROM RanpakValidationSN where SerialNumber = “R50” - ER\_BAD\_FIELD\_ERROR: Unknown column ‘SerialNumber’ in ‘where clause’”

The thing is, there is a column called SerialNumber.

---

<div class="post-metadata">

**Author:** ![David\_MacKenzie](https://avatars.discourse-cdn.com/v4/letter/d/f04885/32.png) [@David\_MacKenzie](https://forums.losant.com/u/David_MacKenzie)\
**Post date:** [June 28, 2021, 2:09pm UTC](https://forums.losant.com/t/sql-where-statement/3886/5 "2021-06-28T14:09:10Z")

</div>

Nevermind close it out. My table only has one column. I had a hunch to try adding another column. Now it works. Nothing else changes.

The query is: SELECT \* FROM RanpakValidationSN where SerialNumber = “R05”

I have no clue why this fixed it.

---

<div class="post-metadata">

**Author:** ![Heath](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/heath/32/3036_2.png) [@Heath](https://forums.losant.com/u/Heath)\
**Post date:** [June 28, 2021, 2:21pm UTC](https://forums.losant.com/t/sql-where-statement/3886/6 "2021-06-28T14:21:59Z")

</div>

@David_MacKenzie,

Glad you were able to get things figured out!

Thank you,  
Heath
