第一个,3月1号之前注册的,并且4月1号之前没有订单的用户数select *
from user u
where registered_time<3月1号
and not exists (select 1 from `order` where user_id=u.id and order_time<4月1号);
from user u
where registered_time<3月1号
and not exists (select 1 from `order` where user_id=u.id and order_time<4月1号);
解决方案 »
- pgsql 我刚不小心执行了update 语句,请问有什么办法回退到原来的值
- 存储过程死活不能执行SELECT @str REGEXP '^[0-9]*$'
- 提问:SQL中的INSERT INTO ... SELECT ...
- 请大家帮帮忙啊,表怎么删除啊。。。。
- 这个视图如何创建?
- /bin/sh /usr/bin/safe_mysqld --defaults-file=/etc/my.
- 狂奇怪,mysql高版本驱动不好使
- 关于mysql用户登陆的入门问题
- 在RedHat Linux7.0下配置Apache+PHP+MySQL 的问题,请提供方法或思路
- 使用phpmyadmin管理MySQL,有个表中出现了一行空白记录
- 请问mysql中 如何可以把一列字段排序后给一列空字段排序赋值
- 查询结果集可以作为表名
from user u
where registered_time<3月1号
and not exists (select 1 from `order` where user_id=u.id and order_time<4月1号)
and exists (select 1 from `order` where user_id=u.id and order_time between 4月1号 and 4月30)
http://topic.csdn.net/u/20090501/15/7548d251-aec2-4975-a9bf-ca09a5551ba5.html
http://topic.csdn.net/u/20100428/09/BC9E0908-F250-42A6-8765-B50A82FE186A.html
http://topic.csdn.net/u/20100626/09/f35a4763-4b59-49c3-8061-d48fdbc29561.html8、如何给分和结贴?
http://community.csdn.net/Help/HelpCenter.htm#结帖