在Mysql运算中四舍五入
今天在写客户返利系统,需要用到这方面的运算。
1.四舍五入 round(123.5)
2.舍去小数 floor(123.5)
3.如果小数部分有值就进一 ceil(123.5) 或者 ceiling(123.5)
示例
select round((select howmuch from fanli_userinfo where username='admin') * 192.7);
By admin|脚本编程|Be the first to comment!
今天在写客户返利系统,需要用到这方面的运算。
1.四舍五入 round(123.5)
2.舍去小数 floor(123.5)
3.如果小数部分有值就进一 ceil(123.5) 或者 ceiling(123.5)
示例
select round((select howmuch from fanli_userinfo where username='admin') * 192.7);
By admin|Web服务器|Be the first to comment!
今天在尝试使用sqlyog时报错如下
Can’t create/write to file ‘/tmp/#sql_b4c_0.MYD’ (Errcode: 24)
解决办法为
[mysqld] tmpdir=/path/to/tmp
今天才知道原来这种gui工具还需要在服务器上给划定一块临时空间
By admin|工作笔记|Be the first to comment!
Loaded Configuration File 被不明原因的指向某个目录下的php.ini ,无法更改,最后将php.ini移出那个目录后解决。但至今没有找到是哪个文件指定了php.ini ? 让我连重现编译php都无法修改。
令一个问题是由mysql命令引起的,下面是来是php的报错:
Warning: File ‘./cangjk/users.MYD’ not found (Errcode: 24) query: SELECT u.*, s.* FROM users u INNER JOIN sessions s ON u.uid = s.uid WHERE s.sid = ’675a70120ec04e0085f1b8a0ae2f596e’ in /home/xiamnn/presite/html/cangjk/includes/presitebase.mysql.inc on line 141
(阅读全文……)
By admin|Web服务器|Be the first to comment!
官方推荐的用法是
DROP USERuser[,user] ...
但在我新迁移的mysql中没有效果,于是可以在use mysql的情况下
delete from user where HOST like “%jeantoe%”;
根据情况不同where的条件需要变化
By admin|工作笔记|2 Comments
为上海市中学生作文竞赛提供服务
平均访问量:2w/天
最高访问量:8w/天
平均数据量:2500 篇文章/天
最高日发文:7000篇文章/天
(阅读全文……)