XpertWorlock Posted July 29, 2010 Share Posted July 29, 2010 Hi, I have a column that contains prices, the type of the column is "Decimal(16,2)". I'm having a problem querying when a price should be above a certain level. Ex. Select * FROM table WHERE price > '500.00' I'm assuming I have to change the query a little bit. Link to comment https://forums.phpfreaks.com/topic/209269-prices-decimals/ Share on other sites More sharing options...
petroz Posted July 29, 2010 Share Posted July 29, 2010 I just ran a little test on a similar environment with a decimal formatted column. SELECT * FROM `order_styles` WHERE `sp` > '600.00' This worked fine for me. Link to comment https://forums.phpfreaks.com/topic/209269-prices-decimals/#findComment-1092829 Share on other sites More sharing options...
XpertWorlock Posted July 30, 2010 Author Share Posted July 30, 2010 It was my fault, a mod_rewrite problem I had with query string. Thanks for taking the time to reply Link to comment https://forums.phpfreaks.com/topic/209269-prices-decimals/#findComment-1092914 Share on other sites More sharing options...
Mchl Posted July 30, 2010 Share Posted July 30, 2010 The field is a numeric datatype, so do not put the price in quotes. This is slowing down (a little, but still) your query. SELECT * FROM `order_styles` WHERE `sp` > 600 Link to comment https://forums.phpfreaks.com/topic/209269-prices-decimals/#findComment-1093005 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.