I have a MySQL table which has a product_id field (big integer)
1102330008
1102330025
1102330070
1103010009
1103010010
1103020006
…
I want to select rows which have product_id = 110301****. I tried to use this query:
SELECT * FROM `product` WHERE (product_id/10000)=110301
but it does not return any values with this message:
MySQL returned an empty result set (i.e. zero rows). ( Query took 0.0005 sec )
MySQL documentation says that
LIKEalso uses indexes so I think you could also use:edit: to fix your own query you would need to use
FLOOR()(documentation) because it results something like:which results 110301,0006 and it’s not equal to
110301