数据准备:一组股票历史成交数据(股票代码:601106 中国一重),起止日期:2011-01-04至今,其中变量有“开盘”、“最高”、“最低”、“收盘”、“总手”、“金额”、“涨跌”等
UPDATE FactStockSET [涨跌] = N'涨'WHERE [涨幅] > 0UPDATE FactStockSET [涨跌] = N'跌'WHERE [涨幅] < 0UPDATE FactStockSET [涨跌] = N'持平'WHERE [涨幅] = 0SELECT [涨跌] , COUNT(*) AS CntFROM FactStockGROUP BY [涨跌]SELECT *FROM FactStockWHERE [涨跌] = N'持平'SELECT MAX(收盘) , MIN(收盘) , AVG(收盘)FROM FactStockUPDATE FactStockSET 序列 = CAST(REPLACE(CONVERT(CHAR(10), SUBSTRING([时间], 1, 10), 120), '-', '') AS INT)SELECT *FROM FactStock
分析过程:
新闻热点
疑难解答