标题: BIT_OR()是用来干什么的? [打印本页] 作者: amazingjxq 时间: 2009-07-19 20:41 标题: BIT_OR()是用来干什么的? 查询实例里面有如下查询
SELECT year,month,BIT_COUNT(BIT_OR(1<<day)) AS days FROM t1
GROUP BY year,month;
文档对BIT_OR的解释如下
BIT_OR(expr)
Returns the bitwise OR of all bits in expr. The calculation is performed with 64-bit (BIGINT) precision.
This function returns 0 if there were no matching rows.
是expr里面所有的位做或运算么?那结果是不是只有一位?作者: cenalulu 时间: 2009-07-20 09:15
下面的例子显示了如何使用位组函数来计算每个月中用户访问网页的天数。
CREATE TABLE t1 ( year YEAR ( 4 ), month INT ( 2 ) UNSIGNED ZEROFILL,