# If condition is true select the specfic record

**URL:** <https://discourse.nodered.org/t/if-condition-is-true-select-the-specfic-record/33004>\
**Category:** General\
**Created:** [17 September 2020 15:17 UTC](https://discourse.nodered.org/t/if-condition-is-true-select-the-specfic-record/33004 "2020-09-17T15:17:25Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![alikhan](https://avatars.discourse-cdn.com/v4/letter/a/ac8455/32.png) [@alikhan](https://discourse.nodered.org/u/alikhan)\
**Post date:** [17 September 2020 15:17 UTC](https://discourse.nodered.org/t/if-condition-is-true-select-the-specfic-record/33004/1 "2020-09-17T15:17:25Z")

</div>

we connect IOT device with MQTT by node-red and push this data into MSSQL.  
what we won't put condition when the x tag value = ON then select only specific data.

we achieve this in the MSSQL query but we want to do in node-red. in the picture, we can select the highlighted data through SQL query. can we do it same in Node-red?

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/d/f/dfbaf4b2e1ccb793bce47e2729983ff9bfdcf374.png)

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [17 September 2020 16:18 UTC](https://discourse.nodered.org/t/if-condition-is-true-select-the-specfic-record/33004/2 "2020-09-17T16:18:38Z")

</div>

Hi @alikhan could you perhaps provide a bit more detail or clarify your requirement? It is not very clear what you are trying to do.

Perhaps a step by step description?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [16 November 2020 16:18 UTC](https://discourse.nodered.org/t/if-condition-is-true-select-the-specfic-record/33004/3 "2020-11-16T16:18:41Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
