mysql之模糊查找和数字取整

<?php

SELECT `goods_id`, `goods_name`, `cat_id`, `brand_id`, `goods_sn`, `goods_number`, `shop_price`, `market_price`, `click_count` FROM `goods` WHERE `goods_name`='诺基亚%'

SELECT `goods_id`, `goods_name`, `cat_id`, `brand_id`, `goods_sn`, `goods_number`, `shop_price`, `market_price`, `click_count` FROM `goods` WHERE `goods_name`like '诺基亚___'

?>
了解了下mysql的取整函数

1.ceil () 向上取整

   例: ceil(1.2) = 2

2.floor () 向下取整

    例: floor(1.2) = 1

3.round() 四舍五入


SELECT ROUND(ct/500)*500 cct ,COUNT(*) FROM user_answercount
GROUP BY cct

SELECT CEIL(ct/500)*500 cct ,COUNT(*) FROM user_answercount
GROUP BY cct




你可能感兴趣的:(mysql之模糊查找和数字取整)