DB 시뮬레이션용 SQL
<SQLite>
1
2
3 |
SELECT trno,shcode,(hotime ||' '||offerho1||' '||bidho1||' '||offerrem1||' '||bidrem1||' '||offerho2||' '||bidho2||' '||offerrem2||' '||bidrem2||' '||offerho3||' '||bidho3||' '||offerrem3||' '||bidrem3||' '||offerho4||' '||bidho4||' '||offerrem4||' '||bidrem4||' '||offerho5||' '||bidho5||' '||offerrem5||' '||bidrem5||' '||offerho6||' '||bidho6||' '||offerrem6||' '||bidrem6||' '||offerho7||' '||bidho7||' '||offerrem7||' '||bidrem7||' '||offerho8||' '||bidho8||' '||offerrem8||' '||bidrem8||' '||offerho9||' '||bidho9||' '||offerrem9||' '||bidrem9||' '||offerho10||' '||bidho10||' '||offerrem10||' '||bidrem10||' '||totofferrem||' '||totbidrem||' '||donsigubun||' '||shcode||' '||alloc_gubun) AS data
FROM tblha_h1_new
|
cs |
1
2
3 |
select trno, shcode, data from (SELECT Num, trno,shcode,(hotime ||' '||offerho1||' '||bidho1||' '||offerrem1||' '||bidrem1||' '||offerho2||' '||bidho2||' '||offerrem2||' '||bidrem2||' '||offerho3||' '||bidho3||' '||offerrem3||' '||bidrem3||' '||offerho4||' '||bidho4||' '||offerrem4||' '||bidrem4||' '||offerho5||' '||bidho5||' '||offerrem5||' '||bidrem5||' '||offerho6||' '||bidho6||' '||offerrem6||' '||bidrem6||' '||offerho7||' '||bidho7||' '||offerrem7||' '||bidrem7||' '||offerho8||' '||bidho8||' '||offerrem8||' '||bidrem8||' '||offerho9||' '||bidho9||' '||offerrem9||' '||bidrem9||' '||offerho10||' '||bidho10||' '||offerrem10||' '||bidrem10||' '||totofferrem||' '||totbidrem||' '||donsigubun||' '||shcode||' '||alloc_gubun) AS data
FROM tblha_h1_new where ddate = shcode = '180400' and hotime > '090000' union SELECT Num, trno, shcode,(chetime||' '|| sign||' '|| change1||' '|| drate||' '|| price||' '|| opentime||' '|| open||' '|| hightime||' '|| high||' '|| lowtime||' '|| low||' '|| cgubun||' '|| cvolume||' '|| volume||' '|| value1||' '|| mdvolume||' '|| mdchecnt||' '|| msvolume||' '|| mschecnt||' '|| cpower||' '|| w_avrg||' '|| offerho||' '|| bidho||' '|| status||' '|| jnilvolume||' '|| shcode ) AS data
FROM tblk3_s3_new where shcode='180400' and chetime > '090000') as a order by num; |
cs |
select trno, shcode, data from (SELECT Num, trno,shcode,(hotime ||' '||offerho1||' '||bidho1||' '||offerrem1||' '||bidrem1||' '||offerho2||' '||bidho2||' '||offerrem2||' '||bidrem2||' '||offerho3||' '||bidho3||' '||offerrem3||' '||bidrem3||' '||offerho4||' '||bidho4||' '||offerrem4||' '||bidrem4||' '||offerho5||' '||bidho5||' '||offerrem5||' '||bidrem5||' '||offerho6||' '||bidho6||' '||offerrem6||' '||bidrem6||' '||offerho7||' '||bidho7||' '||offerrem7||' '||bidrem7||' '||offerho8||' '||bidho8||' '||offerrem8||' '||bidrem8||' '||offerho9||' '||bidho9||' '||offerrem9||' '||bidrem9||' '||offerho10||' '||bidho10||' '||offerrem10||' '||bidrem10||' '||totofferrem||' '||totbidrem||' '||donsigubun||' '||shcode||' '||alloc_gubun) AS data
FROM tblha_h1_new where ddate = shcode = '180400' and hotime > '090000' union SELECT Num, trno, shcode,(chetime||' '|| sign||' '|| change1||' '|| drate||' '|| price||' '|| opentime||' '|| open||' '|| hightime||' '|| high||' '|| lowtime||' '|| low||' '|| cgubun||' '|| cvolume||' '|| volume||' '|| value1||' '|| mdvolume||' '|| mdchecnt||' '|| msvolume||' '|| mschecnt||' '|| cpower||' '|| w_avrg||' '|| offerho||' '|| bidho||' '|| status||' '|| jnilvolume||' '|| shcode ) AS data
FROM tblk3_s3_new where shcode='180400' and chetime > '090000') as a order by num;
<MySQL>
1
2
3
4
5
6
7
8
9
10 |
select trno, shcode, data from (
SELECT Num, trno, shcode, CONCAT_WS(' ', hotime, offerho1, bidho1, offerrem1, bidrem1, offerho2, bidho2, offerrem2, bidrem2, offerho3, bidho3, offerrem3, bidrem3, offerho4, bidho4, offerrem4, bidrem4, offerho5, bidho5, offerrem5, bidrem5, offerho6, bidho6, offerrem6, bidrem6, offerho7, bidho7, offerrem7, bidrem7, offerho8, bidho8, offerrem8, bidrem8, offerho9, bidho9, offerrem9, bidrem9, offerho10, bidho10, offerrem10, bidrem10, totofferrem, totbidrem, donsigubun, shcode, alloc_gubun) AS data
FROM stock.tblha_h1_new
where ddate = '20161202' and shcode = '115530' and hotime > '120600' and hotime < '120800'
union
SELECT Num, trno, shcode, CONCAT_WS(' ', chetime, sign, change1, drate, price, opentime, open, hightime, high, lowtime, low, cgubun, cvolume, volume, value1, mdvolume, mdchecnt, msvolume, mschecnt, cpower, w_avrg, offerho, bidho, status, jnilvolume, shcode ) AS data
FROM stock.tblk3_s3_new
where ddate = '20161202' and shcode = '115530' and chetime > '120600' and chetime < '120800'
) as a
order by Num; |
cs |