Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 11.0.1 (中文) » SQL Anywhere 服务器 - SQL 的用法 » 查询和修改数据 » 查询数据 » 选择列表:指定列

 

查询结果中的字符串

大多数 SELECT 语句产生的结果只包含 FROM 子句指定的表中的数据。但是,通过将字符串括在单引号中并用逗号将它们与选择列表中的其它元素分开,也可以在查询结果中显示这些字符串。字符串中若要包括引号,您需要在它前面再放一个引号。例如:

SELECT 'The department''s name is' AS "Prefix",
   DepartmentName AS Department
FROM Departments;
Prefix Department
The department's name is R & D
The department's name is Sales
The department's name is Finance
The department's name is Marketing
The department's name is Shipping