LOAD DATA LOCAL INFILE 'C:/xampp/htdocs/test/file/sample.csv'
INTO TABLE sample1
FIELDS
        TERMINATED BY ','
        ENCLOSED BY '\"'
LINES
        TERMINATED BY '\r\n'
IGNORE 1 LINES
        (Presidency, President, @x, @x, @x, Party, @x, @x, @x)

可以插入指定的行,忽略的话,可以直接用@dummy或者直接和表对应的列。

 

2. 格式化函数 date_format, 函数相减date_sub,函数相加date_add, 相差天数,月份,年 为interval x day, x month, x year.

date_format(date_sub((select max(Date) from test.cnhub),interval 7 day),"%Y-%m-%d") 

 

3. 取整或者为null变0.

IFNULL(a,0)  //NULL为0

round(a,0)// 取整

 

相关文章:

  • 2022-02-03
  • 2021-07-15
  • 2021-06-20
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-05
  • 2021-12-01
猜你喜欢
  • 2021-09-23
  • 2021-09-26
  • 2021-09-28
  • 2021-08-21
  • 2022-12-23
  • 2022-01-10
  • 2022-12-23
相关资源
相似解决方案