December 23rd, 2008

Concatenate || (attach values), Part 1 of 4

Two alphanumeric character values (or strings) can be attached together (concatenated) to form one value
(or a single string). We do this by using the concatenation symbol || which is two double-bar characters (two key strokes). Only string values can be concatenated.

Format: expression || expression

Example:      'Concat' || 'enation' -> becomes -> 'Concatenation'

> Concatenation does not add a space between the strings.
> Multiple concatenations may be performed. Such as ‘a’ || ‘b’ || ‘c’ becomes ‘abc’.
> Concatenation of an empty string adds nothing to the result. Such as ‘a’ || ” || ‘b’ || ” || ‘c’ becomes ‘abc’.
> If a NULL is used as a string, the result is a NULL. ‘a’ || NULL || ‘b’ || ‘c’ becomes NULL.
> You can concatenate hexadecimal and bit strings. Such as B’0000′ || B’1111′ becomes B’00001111′.
> If you wish to add a non-character value to a string, then that value must be converted to a character
string before the concatenation can be performed.
> The || can be used in SELECT, WHERE, and ORDER BY or anywhere an expression is allowed.
> Oracle treats a NULL as an empty string. Such as ‘Concat’ || NULL || ‘enation’ becomes ‘Concatenation’.
> In MySQL, the || symbol is illegal. MySQL uses CONCAT(). Such as CONCAT(’Concat’, ‘enation’).
> Access and SQL Server uses + between character strings for concatenation. Such as ‘Concat’ + ‘enation’.
> MySQL, Oracle, and PostgreSQL automatically convert non-string data to strings.

9 Responses to ' Concatenate || (attach values), Part 1 of 4 '

Subscribe to comments with RSS or TrackBack to ' Concatenate || (attach values), Part 1 of 4 '.

  1. on December 20th, 2009 at 10:11 pm

    I am definitely bookmarking this page and sharing it with my friends.

    :)

  2. on December 21st, 2009 at 6:13 am

    Very great website.
    The information here is truly valuable.

    I will share it with my friends.

    Cheers

  3. Cheap host said,
    on January 20th, 2010 at 4:19 pm

    I usually do not write blogs, but I would like to say that this place is really forced me to not be so! nice post.

  4. Alkaboola said,
    on January 29th, 2010 at 8:14 pm

    Very nice Blog, I will tell my friends about it.

    Thanks

  5. on February 10th, 2010 at 9:43 am

    It is a pretty decent web site.

    I’ve bookmarked this website and also I will inform my local freinds about this.

    Cheers

  6. on February 10th, 2010 at 1:54 pm

    It is a great web.

    I have bookmarked this particular web site and also I will tell my pals about it.

    Gratitude

  7. WP Themes said,
    on February 13th, 2010 at 1:45 am

    Good fill someone in on and this mail helped me alot in my college assignement. Thank you on your information.

  8. on February 21st, 2010 at 7:01 am

    After reading you site, Your site is very useful for me .I bookmarked your site!
    Wishes your valentine day to be joyful!
    buy cheap shoes

  9. zynga chips said,
    on March 5th, 2010 at 12:34 pm

    i’m quite often wandering on the net most of the morning which means that I have a tendency to read considerably, which unfortunately isnt commonly a beneficial thing as most of the internet sites I look at are constructed of unproductive nonsense copied from other sites a trillion times, nevertheless I have to give you credit this site is genuinely enjoyable and seems to have a bit of original content, therefore thank you for breaking the phenomena of basically duplicating other peoples’ websites, in case you ever want to have fun with playing a couple of hands of facebook poker together just shout out - you have my email address :)

Leave a reply

:mrgreen: :neutral: :twisted: :shock: :smile: :???: :cool: :evil: :grin: :oops: :razz: :roll: :wink: :cry: :eek: :lol: :mad: :sad: