以前写的比较实用的mysql代码[2]从txt中读股票数据
2016-02-16 09:27
603 查看
从txt中读股票数据到mysql里
drop table rc_position;
create table rc_position
(
account char(12) not null,
exchange smallint not null,
stockID char(6) not null,
size int not null,
primary key(account,exchange,stockID)
);
create table rc_stockInfo
(
stockID
char(6) not null,
stockName
char(10) not null,
plateName char(10) not null,
primary key(stockID)
)
select * from rc_stockInfo
delimiter //
drop event if exists e_positiontest;
create event e_positiontest
on schedule every 1 DAY starts
DO
begin
truncate table test.rc_position;
insert into test.rc_position(account,exchange,stockID,size) select * from today.mp_position;
end
//
load data local infile 'X:/jtjz/stock.txt' into table test.rc_stockInfo fields terminated by '\t';
select * from rc_position left join rc_stockinfo on rc_position.stockID=rc_stockinfo.stockID where stockName like '%st%';
drop table rc_position;
create table rc_position
(
account char(12) not null,
exchange smallint not null,
stockID char(6) not null,
size int not null,
primary key(account,exchange,stockID)
);
create table rc_stockInfo
(
stockID
char(6) not null,
stockName
char(10) not null,
plateName char(10) not null,
primary key(stockID)
)
select * from rc_stockInfo
delimiter //
drop event if exists e_positiontest;
create event e_positiontest
on schedule every 1 DAY starts
DO
begin
truncate table test.rc_position;
insert into test.rc_position(account,exchange,stockID,size) select * from today.mp_position;
end
//
load data local infile 'X:/jtjz/stock.txt' into table test.rc_stockInfo fields terminated by '\t';
select * from rc_position left join rc_stockinfo on rc_position.stockID=rc_stockinfo.stockID where stockName like '%st%';
相关文章推荐
- 以前写的比较实用的mysql代码[1]
- mysql56 service
- mysql show processlist 命令详解
- MySQL中Btree和Hash的局限小结
- mysql设置指定ip远程访问连接实例
- 5.6,5.7mysql zip版本 安装配置步骤
- MySql模糊查询like通配符使用详细介绍
- 'mysql' 不是内部或外部命令,也不是可运行的程序或批处理文件的解决办法
- MySQL连接及基本信息查看命令汇总
- Windows下MySQL5.7.11安装记录
- Mysql 主从复制安装指南
- MySql索引算法原理解析(通俗易懂,只讲B-tree)
- MySQL性能优化的最佳20+条经验
- Mysql 优化 Notes
- MYSQL数据类型优化
- Mysql中组合的insert和update语句
- MySQL中的级联约束
- MySQL将查询结果输出都爱服务器文件中
- MYSQL优化
- mysql 备份与还原