MySQL node, how to query "equal to or more"?

I am using node-red-node-mysql to query a database.

I want to return only the rows where the column number has a value of 5 or more.

msg.payload = ['>=5']

msg.topic = "SELECT * FROM myTable WHERE number = ?;"

return msg;

But this query returns 0 rows.

If I specify the number, it works:

msg.payload = [6]

msg.topic = "SELECT * FROM myTable WHERE number = ?;"

return msg;

Returns all rows where number is 6.

How do I write this query so it works the way I want it to?

I don't use the node myself, so this is just a guess.

msg.payload = [5]
msg.topic = "SELECT * FROM myTable WHERE number >= ?;"
return msg;
1 Like

Of course, why did I not think of that, so simple.. Thanks!

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