Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
当我将元素添加到列(varchar)时,我得到了额外的空间。例如,如果我有一张桌子Student,name varchar(10)我会这样做:
Student
name varchar(10)
INSERT INTO Student (id,name) VALUES (1,'student') SELECT name FROM Student WHERE id=1
我明白了student[space][space][space]。
student[space][space][space]
如何在不将类型更改为的情况下进行修复text?
text
大多数数据库以固定的表格格式输出查询结果。要查看字符串的真正开始和结束位置,您需要连接另一个字符。以下是三种方式,具体取决于数据库:
select '"'+name+'"' select '"'||name||'"' select concat('"', name, '"')
您可能会发现空格是查询工具的产物。