- 浏览: 5880 次
- 性别:
- 来自: 广州
最新评论
-
xiangch:
<div class="quote_title ...
三种方式查询A表的数据没有出现在B表的数据中(not in, left join, not exists)
文章列表
装完ubuntu server-11.04忘记刚刚设计的密码,于是就在网上找了解决方案。
以下为操作全过程
sudo /etc/init.d/mysql stop
Rather than invoking init scripts through /etc/init.d, use the service(8)
utility, e.g. service mysql stop
Since the script you are attempting to invoke has been converted to an
Upstart job, you may also use the stop(8) ...
1 打开 http://ditu.google.com/maps
2 找到你要获得坐标的地点, 把他置于屏幕中央
3 在浏览器栏输入
javascript:void(prompt('',gApplication.getMap().getCenter()));
A表(users)
字段:
uid int not null primary key,
uname nvarchar(30) not null
B表(results)
字段:
rid int not null primary key,
uid int not null(引用users表的uid)
查询A表中的数据没有出现在B表中
1.使用 not in
select * from users where uid not in (select uid from results)
2.使用 left join
select u.* from users as u lef ...
商品销售表(orders)
字段:
订单号(order_id int)
商品名(product_name nvarchar)
销售时间(sale_date int)记录星期如(1,2,3,4,5,6,7)
销售数量(sale_count int)
查询商品一星期每天的销售记录,如下方式显示
product_nameSunMonTueWedThuFriSat
select product_name,
'Sun' = sum(case sale_date when 7 then sale_count end),
'Mon' = sum(case sale ...
方案一:
l = [[1,2],[3,4],[5,6]]
[l[i/2][i%2] for i in range(0,len(l*2))]
方案二:
sum([[1,2],[3,4],[5,6]],[])
刚刚学习Python.