我想弄清楚如何將相同的值插入到表的整個列中?該表已經存在,我有一個空列,我想插入一個特定的值,例如今天的日期。我只找到解釋如何將值插入整行的來源。在PostgreSQL的列中插入值
4
A
回答
6
`UPDATE myTable SET myColumn='newValue'`
NEWVALUE也可以是一個表達式。
看到http://www.postgresql.org/docs/8.4/interactive/sql-update.html
1
我想我們需要一個多一點信息,以瞭解這個問題,這聽起來像你只是想......
INSERT INTO table_foo (my_empty_column_name) values (current_date);
如果你已經有數據那裏,你要更新所有列然後行...
UPDATE table_foo SET my_empty_column_name = current_date;
0
好像你應該能夠做這樣的事情:
INSERT INTO films (title) VALUES ('Tampopo'), WHERE TRUE;
(摘自:http://www.postgresql.org/docs/8.2/static/sql-insert.html)
1
我想你想UPDATE。
UPDATE myTable set myColumn = 'WHATEVER'
相關問題
- 1. PostgreSQL的插入小數值
- 2. 在PostgreSQL中插入多個ENUM值
- 3. 如何在PostgreSQL中插入缺失列的值?
- 4. PostgreSQL - 時間序列插值
- 5. 在PostgreSQL中插入緩慢
- 6. 如何限制postgresql中特定列的插入值?
- 7. 四捨五入postgresql中的列值
- 8. 忽略PostgreSQL視圖上的列插入
- 9. 在Postgresql中插入枚舉的問題
- 10. 在PostgreSQL中插入帶單引號的值
- 11. 如何在DES中插入加密值到Postgresql DB中?
- 12. PHP沒有插入PostgreSQL中
- 13. PostgreSQL:條件插入默認值
- 14. 將數組值插入數據庫postgresql
- 15. 使用JDBC將值插入postgresql
- 16. 用c在postgresql DB中插入錯誤#
- 17. 在postgresql中插入一個數組
- 18. PostgreSQL - 在條件插入後中止
- 19. 在postgresql中插入或更新9.1
- 20. 如何通過壺在PostgreSQL表中插入UUID值?
- 21. 在influxdb中插入列表作爲值
- 22. 在datetime列中插入默認值
- 23. 在mybatis中插入值列表
- 24. 在列中插入多個增量值
- 25. 在mysql中插入一系列值
- 26. 爲什麼.add()在列中插入值?
- 27. 在datetime列中插入值時出錯
- 28. 將java GUI中的值插入到postgresql數據庫中
- 29. 值插入空列
- 30. 插入值列表