From 576c1a146e4111fc7dc70654d55ff8e9f2c53152 Mon Sep 17 00:00:00 2001 From: mjjo Date: Mon, 22 Jun 2015 18:33:08 +0900 Subject: [PATCH] =?UTF-8?q?=EC=A4=91=EA=B0=84=20=EA=B2=B0=EA=B3=BC?= =?UTF-8?q?=EC=9A=A9=20=ED=85=8C=EC=9D=B4=EB=B8=94=20=EC=83=9D=EC=84=B1=20?= =?UTF-8?q?=EB=B0=8F=20=EA=B2=80=EC=83=89=20=EC=BF=BC=EB=A6=AC=20=ED=98=95?= =?UTF-8?q?=ED=83=9C=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sql/create.sql | 17 ++++++++++++++--- sql/search.sql | 17 ++++++++++++++++- 2 files changed, 30 insertions(+), 4 deletions(-) diff --git a/sql/create.sql b/sql/create.sql index 08d3406..99cffb9 100644 --- a/sql/create.sql +++ b/sql/create.sql @@ -1,11 +1,22 @@ CREATE TABLE option_list ( -seq INT NOT NULL AUTO_INCREMENT PRIMARY KEY, +seq INT NOT NULL AUTO_INCREMENT, CODE VARCHAR(10), DATE DATETIME, fin_price FLOAT, deal_amount INT, deal_cash BIGINT, -comp_bid INT +comp_bid INT, +PRIMARY KEY(seq) +); -) \ No newline at end of file + +drop table if exist futopt_list +create table futopt_list +( + seq int auto_increment, + deal_cash bigint, + date datetime, + fin_price float, + primary key(seq) +); \ No newline at end of file diff --git a/sql/search.sql b/sql/search.sql index b835097..1932154 100644 --- a/sql/search.sql +++ b/sql/search.sql @@ -32,4 +32,19 @@ FROM ON o.date=f.date AND f.deal_cash >= 10000000000) AS sl LEFT OUTER JOIN option_list o2 ON o2.date>=sl.date AND o2.date<=DATE_ADD(sl.date, INTERVAL 30 SECOND) -GROUP BY sl.date \ No newline at end of file +GROUP BY sl.date + + +-- procedure +insert into futopt_list(deal_cash, date, fin_price) + +SELECT f.deal_cash as deal_cash, o.date as date, o.fin_price as fin_price + FROM future_list f LEFT OUTER JOIN option_list o + ON f.deal_cash >= 10000000000 and o.date!=null + + +select * from futopt_list + + +create procedure futopt.FindBigDeal() +BEGIN \ No newline at end of file