| Tags: String, concatenation, operator, Sybase, T SQL, |
|
String concatenation operator in Sybase T-SQL
|
|
02-03-2010, 11:06 PM
Post: #1
|
|||
|
|||
|
String concatenation operator in Sybase T-SQL
Know Sybase T-SQL String concatenation operator
You can use both the + and || (double-pipe) string operators to concatenate two or more character or binary expressions. For example, the following displays author names under the column heading Name in last-name first-name order, with a comma after the last name; for example, “Bennett, Abraham.”: select Name = (au_lname + ", " + au_fname) from authors This example results in "abcdef", "abcdef": select "abc" + "def", "abc" || "def" The following returns the string “abc def”. The empty string is interpreted as a single space in all char, varchar, unichar, nchar, nvarchar, and text concatenation, and in varchar and univarchar insert and assignment statements: select "abc" + "" + "def" When concatenating non-character, non-binary expressions, always use convert: select "The date is " + convert(varchar(12), getdate()) A string concatenated with NULL evaluates to the value of the string. This is an exception to the SQL standard, which states that a string concatenated with a NULL should evaluate to NULL. Reference : Sybase Manuals JP, TechSupport-Member(SybaseTeam.Com) |
|||
|
« Next Oldest | Next Newest »
|
| Possibly Related Threads... | |||||
| Thread: | Author | Replies: | Views: | Last Post | |
| Need help in converting String to Date format | surbhit4u | 0 | 138 |
06-22-2010 01:05 PM Last Post: surbhit4u |
|
| REPLACE function [String] in Sybase Adaptive Server(ASE) | crazYoga | 0 | 609 |
02-02-2010 02:18 AM Last Post: crazYoga |
|
| SQL to Replace String in Sybase | john | 0 | 1,527 |
12-09-2009 05:15 PM Last Post: john |
|
| Replace string in Sybase | Joshi | 0 | 175 |
09-09-2009 01:49 AM Last Post: Joshi |
|
| sybase string functions with examples | john | 0 | 636 |
07-07-2009 02:30 AM Last Post: john |
|
| T-SQL: A Simple Way to Build a String from a Column | zaadmin | 0 | 227 |
10-10-2008 09:50 PM Last Post: zaadmin |
|


Chat Support
Search
Disclaimer & Rules
Help


