【Postresql】插入字符串问题
来源:互联网 发布:笔记本支架哪个好 知乎 编辑:程序博客网 时间:2024/05/21 06:21
在使用postgresql进行数据插入时,出现错误
INSERT INTO table1 (name,number) VALUES ("王",123)
提示 “王” 这个列错误。数据库将”王”数据识别成了列数据。查看官方文档得知,postgresql对于字符串需要用单引号进行标识。
4.1.2.1. String Constants
A string constant in SQL is an arbitrary sequence of characters bounded by single quotes (‘), for example ‘This is a string’. To include a single-quote character within a string constant, write two adjacent single quotes, e.g., ‘Dianne”s horse’. Note that this is not the same as a double-quote character (“).
https://www.postgresql.org/docs/9.3/static/sql-syntax-lexical.html#SQL-SYNTAX-CONSTANTS
修正后的指令
INSERT INTO table1 (name,number) VALUES ('王',123)
阅读全文
0 0
- 【Postresql】插入字符串问题
- PostreSQL崩溃试验全记录
- 插入字符串
- 字符串插入
- 字符串插入
- 字符串插入
- 字符串插入
- 字符串插入
- 字符串插入
- 字符串插入
- java数组、字符串比较插入及排序问题
- python字符串中包含Unicode插入数据库乱码问题
- python汉字字符串插入数据库的乱码问题
- 字符串插入字符串函数
- python字符串中插入字符串
- IOS 字符串中插入字符串
- 字符串中插入其他字符串
- 字符串插入分割字符
- Python中函数的参数定义和可变参数
- MySQL性能优化总结
- k-means及变种
- (转)vs2012搜索出问题,只显示搜索的匹配数量不显示具体路径
- 第7章 课程机构功能实现
- 【Postresql】插入字符串问题
- UVa 1152 4 Values whose Sum is 0——二分
- 开发遇到的坑:RecyclerView.Adapter notifyDataSetChanged 不起作用
- html基础知识一
- 【数据库】序列化
- Linux定时任务Crontab命令详解
- IoT时代的无线通讯技术
- 20170601_C++中vector多维数组初始化及清零
- C++ map 根据value找key