2013年12月25日

MergeData

摘要: @echo offtitle PubwinTool By 76449628color 0Aif not exist "%java_home%\bin\java.exe" goto end2:firclsecho use local >test.sqlecho go >test.sqlset /p pwd="请输入数据库访问密码:"OSQL /S localhost /U netcafe /P %userpwd% /i test.sqlIF ERRORLEVEL 1 goto end1del /f /q test.sqlclsosql -U n 阅读全文

posted @ 2013-12-25 16:55 awk 阅读(329) 评论(0) 推荐(0)

2013年12月4日

连锁数据整理

摘要: 1.update mem_memberaccount set level=4 where id in (select id from (select a.id,a.uniqueid,a.levelname,b.level from mem_memberbaseinfo a,mem_memberaccount b where a.id=b.id) x where level='5' and levelname'vip');2.update mem_memberbaseinfo set levelname=(select name from mem_chainmem 阅读全文

posted @ 2013-12-04 18:57 awk 阅读(138) 评论(0) 推荐(0)

2013年10月9日

如何去掉数据库重复记录并且只保留一条记录

摘要: 在n条记录里,存在着些相同的记录,如何能用SQL语句,删除掉重复并保留一条呢?方法如下:1、查找表中多余的重复记录,重复记录是根据单个字段(peopleId)来判断[sql]select * from people where peopleId in (select peopleId from people group by peopleId having count(peopleId) > 1) 2、删除表中多余的重复记录,重复记录是根据单个字段(peopleId)来判断,只留有rowid最小的记录[sql]delete from people where peopleId in (s 阅读全文

posted @ 2013-10-09 12:48 awk 阅读(204) 评论(0) 推荐(0)

合并数据库重复记录处理

摘要: 1.updatemem_localmemberbaseinfosetbalance=(selectbfrom(selectcount(uniqueid)asa,sum(balance)asbgroupbyuniqueidhavingcount(uniqueid)>1)x)whereuniqueid=(selectdfrom(selectcount(uniqueid)asc,uniqueid asdgroupbyuniqueidhavingcount(uniqueid)>1)x)andid>100000;2.delete from mem_localmemberbaseinfo 阅读全文

posted @ 2013-10-09 11:49 awk 阅读(400) 评论(0) 推荐(0)

2013年9月8日

linux daemon相关重要目录

摘要: 1.目录/etc/init.d 启动脚本放置处/etc/sysconfig 各服务的初始化环境配置文件目录/etc/xinetd.conf,/etc/xinetd.d super daemon配置文件/etc/ 各服务各自的配置文件/etc/lib 各服务产生的数据库/var/run 各服务的程序PID记录处2.启动stand alone的启动eg:/etc/init.d/syslog statusservice syslog statusstatus/stop/restart 阅读全文

posted @ 2013-09-08 21:24 awk 阅读(238) 评论(0) 推荐(0)

2013年9月4日

双色球数据库简单构建

摘要: 1.CREATE DATABASEuse mastergocreate database ssq on(name=ssq_dat,filename='e:\ssq.mdf',size=100mb,maxsize=500mb,filegrowth=10mb)log on(name=ssq_log,filename='e:\ssq.ldf',size=50mb,maxsize=300mb,filegrowth=5mb);go2.CREATE TABLEcreate table ssq_data2003(date_ssq int NOT NULL,number_ssq 阅读全文

posted @ 2013-09-04 15:23 awk 阅读(790) 评论(0) 推荐(0)

2013年7月22日

sqlserver高级查询

摘要: 1.Union两个结果集a、b中所包括的所有行,消除重复行。Union All不消除重复行。2.Except两个结果集a、b,只存在于a中,但不存在于b中的行。Except All不消除重复行。3.Intersect两个结果集a、b,既存在于a又存在于b的行。All时不消除匹配行。4.left outer join结果包含左表中的所有行和匹配行。5.right outer join结果包含右表中的所有行和匹配行。6.full outer join不仅包括匹配行,还包括左右表中的所有行。 阅读全文

posted @ 2013-07-22 16:49 awk 阅读(159) 评论(0) 推荐(0)

2013年7月21日

合并数据库重复的uniqueid存储过程

摘要: 1.建立存储过程create procedure s_memberasdeclare @su intselect @su = sumu from ( select count(uniqueid) as count,sum(balance) as sumu from mem_localmemberbaseinfo group by uniqueid having count(uniqueid)>1) xreturn @su2.调用存储过程declare @sum_m intexecute @sum_m=s_memberselect @sum_m 阅读全文

posted @ 2013-07-21 16:07 awk 阅读(209) 评论(0) 推荐(0)

2013年7月20日

sqlserver联结分组练习

摘要: 问题描述:为管理岗位业务培训信息,建立3个表:S (S#,SN,SD,SA) S#,SN,SD,SA 分别代表学号、学员姓名、所属单位、学员年龄C (C#,CN ) C#,CN 分别代表课程编号、课程名称SC ( S#,C#,G ) S#,C#,G 分别代表学号、所选修的课程编号、学习成绩要求实现如下5个处理: 1. 使用标准SQL嵌套语句查询选修课程名称为’税收基础’的学员学号和姓名 2. 使用标准SQL嵌套语句查询选修课程编号为’C2’的学员姓名和所属单位 3. 使用标准SQL嵌套语句查询不选修课程编号为’C5’的学员姓名和所属单位 4. 使用标准SQL嵌套语句查询选修全部课程的学员姓名和 阅读全文

posted @ 2013-07-20 21:38 awk 阅读(241) 评论(0) 推荐(0)

sqlserver操作整理

摘要: 1.检索数据单列:select a from table where...多列:select a,b from table where...所有列:select * from table where...不同值:select distinct a from table where...限制结果:select top 5 a from table where...按名称排序检索:select a,b from table where... order by a,b按位置排序检索:select a,b from table where... order by 2,1降序检索:select a,b 阅读全文

posted @ 2013-07-20 19:50 awk 阅读(140) 评论(0) 推荐(0)

导航