【问题标题】:Filling All column of a table with specific value in PostgreSQL?在PostgreSQL中用特定值填充表的所有列?
【发布时间】:2012-11-14 21:51:09
【问题描述】:

我有一个表格,我想用特定值填充一列。

示例表: 它包括空的温度列,我想用 4.56 填充相关列的所有行。

+------------+------------------+ |温度 |dt | +------------+------------------+ | |9/15/2007 12:12:12| | |9/15/2007 12:14:16| | |9/15/2007 12:16:02| | |9/15/2007 12:18:23| | |9/15/2007 12:21:01| +------------+------------------+

结果:

+------------+------------------+ |温度 |dt | +------------+------------------+ | 4.56 |9/15/2007 12:12:12| | 4.56 |9/15/2007 12:14:16| | 4.56 |9/15/2007 12:16:02| | 4.56 |9/15/2007 12:18:23| | 4.56 |9/15/2007 12:21:01| +------------+------------------+

【问题讨论】:

    标签: postgresql fill autofill


    【解决方案1】:
    update the_table
       set temperature = 4.56;
    commit;
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-10-26
      • 2021-09-10
      • 2013-04-15
      • 1970-01-01
      • 2013-12-19
      • 2021-09-16
      相关资源
      最近更新 更多