Concatenating Fields
来源:互联网 发布:linux配置dns命令 编辑:程序博客网 时间:2024/04/27 18:27
In SQL SELECT statements, you can concatenate columns using a special operator. Depending on which DBMS you are using, this can be a plus sign (+) or two pipes (||).
+ or ||? Access, SQL Server, and Sybase support + for concatenation. DB2, Oracle, PostgreSQL, and Sybase support ||. Refer to your DBMS documentation for more details.
|| is actually the preferred syntax, so more and more DBMSs are implementing support for it.
SELECT vend_name + ' (' + vend_country + ')'
FROM Vendors
ORDER BY vend_name;
Many databases (although not all) save text values padded to the column width. To return the data formatted properly, you must trim those padded spaces. This can be done using the SQL RTRIM() function
SELECT RTRIM(vend_name) + ' (' + RTRIM(vend_country) + ')'
FROM Vendors
ORDER BY vend_name;
The TRIM Functions Most DBMSs support RTRIM() (which, as just seen, trims the right side of a string), as well as LTRIM() (which trims the left side of a string), and TRIM() (which trims both the right and left).
- Concatenating Fields
- Tutorial 11 - Concatenating Transformations
- Creating and Concatenating Matrices
- Concatenating row values in Transact-SQL
- OpenGL教程翻译 第十一课 Concatenating Transformations
- Solr Fields字段Copying Fields/Dynamic Fields
- 17.4 Fields
- 17.4 Fields
- Volatile Fields
- Corn Fields
- Corn Fields
- POJ_3254_Corn Fields
- Text Fields
- POJ3254Corn Fields
- Corn Fields
- Corn Fields
- scikit学习心得——Concatenating multiple feature extraction methods
- Trimming form fields
- 只拷贝文件的驱动程序构建方法
- DIY min2440 Linux系统
- C语言中的移位操作
- 让span有固定宽度 兼容IE和firefox
- winCE改变字库方法
- Concatenating Fields
- 数据仓库客户信息整合
- 负载均衡
- C#Application.DoEvents();的作用。
- Windows Mobile boot 过程详解
- 模拟系统nbtstat 的代码实现
- jvm与tomcat内存设置
- 分离字库来减少中文版WinCE的下载大小
- 求DREAMWEAVER8插件