解决方案 »
- 求助!《数据库系统概论》上的一道习题,查询遇到难题了。
- 关于 Mysql MMM
- 对超大数量数据的处理
- 大家帮我看看mysql查询语句如何写
- mysql错误“multiple-step operation generated error.....”究竟能不能解决啊
- linux mysql Errcode:13
- 【PostgresQL】将空字符串''插入时,自动转变为null插入数据库中
- 如果字段类型是int系列的,比如id smallint(4),可以update set id=id+1...,但如果字段类型是varchar(255)呢
- MySQL Connector/J 3.0 的配置?
- 【sql问题】distinct 改成group by 用法
- postgreSQL中获取中文乱码问题
- MysSql 报错如下,是什么原因?
from work_log
group by name,work_date
with ROLLUP) b
where name is not null and work_date is null and counts is not null
select name,work_date ,count(*) as counts
from work_log
group by name,work_date
union
select null,null,count(*) as counts
from work_log
from work_log
group by name,work_date
having isnull(name) xor isnull(work_date)=0
with ROLLUP;
我从来没用过 xor 这个关系符!学习学习,哈哈。
额 俺也没整过 XOR 第一次看到这个词, 上面的语句改成
select name,work_date ,count(*) as counts
from work_log
group by name,work_date
with ROLLUP
having isnull(name) xor isnull(work_date)=0
可以正常运行