易截截图软件、单文件、免安装、纯绿色、仅160KB

shell中使用SQL实现查询

 先把文本进行格式处理,然后以空格为分隔符,取第二个空格后的字串,排序,去重,再降序排列,取前5个
arr=($(cat 0100055F_Detail.txt|sed -e '/:/d'|awk -F ' ' '{print$2}'|sort|uniq -c|sort -nr|head -5|awk '{print $2}'))
len=${#arr[@]}  获取数组长度
for((i=0;i<$len;i++))
do
echo ${arr[$i]}
mysql -uroot -p123456 -e "select location from IPLocation.IPLocation where IP_address='${arr[$i]}'"|sed 's/\t/,/g' >> table.csv   执行查询:-u后是用户名,-p后事密码,-e表示执行;
done
cat table.csv|sed -e '/location/d'>table1.csv
paste -d ',' result.csv table1.csv >last.csv 两个文件按列合并,并且两文件的结合列中用逗号分隔。


相关文档:

sql server 2000 全文索引全解

 http://hi.baidu.com/dumao/blog/item/1cafa71e5886d019413417e4.html
1.全文索引概述
对 Microsoft® SQL Server™ 2000 数据的全文支持涉及两个功能:对字符数据发出查询的能力和创建及维护基础索引以简化这些查询的能力。
全文索引在许多地方与普通的 SQL 索引不同。
普通 SQL 索引全文索引
存储时受 ......

1.The SQL introuduction

Introducing Oracle Database 11g
List the features of Oracle Database 11g
Discuss the basic design, theoretical and physical aspects of a relational database
Categorize the different types of SQL statements
Describe the data set used by the course
Log onto the database using the SQL Develope ......

SQL SERVER 2005相关问题

已成功与服务器建立连接,但是在登录前的握手期间发生错误的处理方法
      在用SQL SERVER 用户登陆SQL SERVER 2005时,弹出一个对话框,提示" 已成功与服务器建立连接,但是在登录前的握手期间发生错误",查找了一下原因,原来是SQL SERVER 2005时禁用TCP/IP登陆了,打开SQL SERVER 2005菜 ......

SQL SERVER日期时间函数

 来源http://hi.baidu.com/smilevt/blog/item/04bddeef0fe3f42e2cf5348b.html这里还有很多sql server的帖子
1. 当前系统日期、时间
select getdate()
2. dateadd 在向指定日期加上一段时间的基础上,返回新的 datetime 值
例如:向日期加上2天
select dateadd(day,2,'2004-10-15') --返回:2004-10-17 00:00:00. ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号