Reputation: 65
I have objects like:
address: {
"phone" : 888,
"value" : 12
}
And in WHERE
i need to find objects by address.value, but in SQL there's function value()
, so i always get an error.
I do it from node.js. Are there any variants to solve this without changing objects? Sql request like:
SELECT count(*) as size FROM addresses WHERE address.value = 12
Upvotes: 3
Views: 398
Reputation: 1890
VALUE is a reserved word. If you want to use it as a common identifier, you need to enclose it in backticks:
SELECT count(*) as size FROM addresses WHERE address.`value` = 12
Upvotes: 3