ITeye博客

pengleong

pengleong · 共 5 篇文章

Linux下修改MySQL用户root的密码

装完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(…

2011-06-17T18:00:55Z · 数据库 · 评论(0)

获取Google Map坐标

1 打开 http://ditu.google.com/maps 2 找到你要获得坐标的地点, 把他置于屏幕中央 3 在浏览器栏输入 javascript:void(prompt('',gApplication.getMap().getCenter()));

2010-11-18T17:08:12Z · Web前端 · 评论(0)

三种方式查询A表的数据没有出现在B表的数据中(not in, left join, not exists)

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 left join result…

2010-10-27T23:30:15Z · 数据库 · 评论(1)

分组统计商品一星期每天的销售情况

商品销售表(orders) 字段: 订单号(order_id int) 商品名(product_name nvarchar) 销售时间(sale_date int)记录星期如(1,2,3,4,5,6,7) 销售数量(sale_count int) 查询商品一星期每天的销售记录,如下方式显示 |product_name|Sun|Mon|Tue|Wed|Thu|Fri|Sat | | | | | | | | | select product_name, 'Sun' = sum(case sale_date when 7 then sale_count end), 'Mon' = sum(case…

2010-10-27T15:25:51Z · 数据库 · 评论(0)

[[1,2],[3,4],[5,6]] 转 [1,2,3,4,5,6]

方案一: 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.

2010-09-09T20:40:47Z · 编程语言 · 评论(0)