# Filter Records from Mysql

**URL:** <https://discourse.nodered.org/t/filter-records-from-mysql/73726>\
**Category:** General\
**Created:** [15 January 2023 19:42 UTC](https://discourse.nodered.org/t/filter-records-from-mysql/73726 "2023-01-15T19:42:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ankit.prasad](https://avatars.discourse-cdn.com/v4/letter/a/ea5d25/32.png) [@ankit.prasad](https://discourse.nodered.org/u/ankit.prasad)\
**Post date:** [15 January 2023 19:42 UTC](https://discourse.nodered.org/t/filter-records-from-mysql/73726/1 "2023-01-15T19:42:05Z")

</div>

MQTT Data is [{"device\_mac":"BC572900A0CD","temp":24.56,"humidty":50.81,"rssi":-83,"ver":1,"x0":-968,"y0":-359,"z0":-93,"type":1,"time":1673811297266000000},{"host":"BC572900A0CD"}]  
[{"device\_mac":"BC572900A052","temp":24.45,"humidty":60.62,"rssi":-85,"ver":1,"x0":-46,"y0":46,"z0":1031,"type":1,"time":1673811393808000000},{"host":"BC572900A052"}]

Consider I have a Mysql table which has device mac address.  
eg. select mac\_address from device\_info ;  
BC572900A052  
And I want to use a query and get records and restrict or limit data other than the result set

And Only items that are available in the result set should be filtered from the mqtt data ,

How to filter records using mysql from mqtt topic

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [15 January 2023 21:19 UTC](https://discourse.nodered.org/t/filter-records-from-mysql/73726/2 "2023-01-15T21:19:51Z")

</div>

In order to make code readable and usable it is necessary to surround your code with three backticks (also known as a left quote or backquote `````)

````auto
``` 
   code goes here 
```

````

You can edit and correct your post by clicking the pencil ✏ icon.

See this post for more details - [How to share code or flow json](https://discourse.nodered.org/t/how-to-share-code-or-flow-json/506)

---

<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 March 2023 21:20 UTC](https://discourse.nodered.org/t/filter-records-from-mysql/73726/3 "2023-03-16T21:20:11Z")

</div>

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