LOAD DATA LOCAL INFILE在小时为00时产生null。只有最后两行正确导入 有人可以帮助我吗
查询:
LOAD DATA LOCAL INFILE 'test.csv'
INTO TABLE stats.Counters_ACTIVEUE
FIELDS TERMINATED BY ","
OPTIONALLY ENCLOSED BY '"'
LINES TERMINATED BY "\n"
IGNORE 1 LINES
(@varTimeSt,NOMINAL,CELL_ID,IPLATEDL_MS_QCI_9,PDCPSDUDELAY_MSEC_QCI_9,UEACTIVEUL_COUNT_QCI_9,
UEACTIVEDL_COUNT_QCI_9) SET DAY = STR_TO_DATE(@varTimeSt,'%m/%d/%Y %h:%i');
数据:
DAY,NOMINAL,CELL_ID,IPLATEDL_MS_QCI_9,PDCPSDUDELAY_MSEC_QCI_9,UEACTIVEUL_COUNT_QCI_9,UEACTIVEDL_COUNT_QCI_9
"09/05/2016 00:00",CE0001,cNum6,5.17,58.285,0.5725,0.9275
"09/05/2016 00:00",CE0001,cNum7,4.9025,40.385,0.17,0.235
"09/05/2016 01:00",CE0001,cNum8,1.8075,23.58,0.2175,0.8925
"08/30/2016 01:00",CE0001,cNum1,5.295,16.34,0.0875,0.17
答案 0 :(得分:7)
%h
是12小时内小时的格式代码。这种格式的一小时必须在1-12范围内;它不能是0。
由于您的时间似乎是24小时格式,因此您可能需要%H
。这也应该解决你在12:59之后遇到的任何问题。