아미(아름다운미소)

sqlite 범위지정후 SUM 하기 본문

데이타베이스/SQLite

sqlite 범위지정후 SUM 하기

유키공 2018. 11. 6. 11:00

sqlite 범위지정후 SUM 하기 

SELECT * FROM stockInfoStatic60 WHERE code ='055550' ORDER BY reg_date DESC LIMIT 5 OFFSET 1;

SELECT SUM(close)/5 AS SUM

FROM (SELECT * FROM stockInfoStatic60 WHERE code ='055550' ORDER BY reg_date DESC LIMIT 5 OFFSET 1);


Comments