Home » RDBMS Server » Server Administration » Urgent Urgent !
Urgent Urgent ! [message #373143] Thu, 29 March 2001 08:27 Go to next message
Atif Iqbal
Messages: 2
Registered: March 2001
Junior Member
Sir !

I am doing my majors in computer sciences. I have to submit an assignment on SQL operators and function.
One thing that is disturbing me is that I couldn't find the difference between CONCAT function and concatenation operator (||). Will u please write about their basic differences in detail.
Your prompt reply will be highly appreciated.
Re: Urgent Urgent ! [message #373144 is a reply to message #373143] Thu, 29 March 2001 08:39 Go to previous messageGo to next message
Atif Iqbal
Messages: 2
Registered: March 2001
Junior Member
Sir !

I am doing my majors in computer sciences. I have to submit an assignment on SQL operators and function.
One thing that is disturbing me is that I couldn't find the difference between CONCAT function and concatenation operator (||). Will u please write about their basic differences in detail.
Your prompt reply will be highly appreciated.
Concatenate [message #373145 is a reply to message #373143] Thu, 29 March 2001 09:26 Go to previous messageGo to next message
Hari
Messages: 59
Registered: August 2000
Member
CONCATENATE

SQL99 defines a concatenation operator ( || ), which joins two distinct strings into one string value. The CONCATENATE function appends two or more strings together, producing a single output string. PostgreSQL and Oracle support the double-pipe concatenation operator. Microsoft SQL Server uses the plus sign (+) concatenation operator.

MySQL supports a similar function, CONCAT( ). Refer to the "Concatenation Operators" section Chapter 3, SQL Statements Command Reference, for more information on concatenation within Oracle, PostgreSQL, and Microsoft SQL Server.

SQL99 Syntax

CONCATENATE('string1' || 'string2')

MySQL Syntax

CONCAT(str1, str2, [[,...n]])

If any of the concatenation values are null, the entire returned string is null. Also, if a numeric value is concatenated, it is implicitly converted to a character string:

SELECT CONCAT('My ', 'bologna ', 'has ', 'a ', 'first ', 'name...');
-> 'My bologna has a first name...'
SELECT CONCAT('My ', NULL, 'has ', 'first ', 'name...');
-> NULL
Re: Urgent Urgent ! [message #373146 is a reply to message #373143] Thu, 29 March 2001 09:29 Go to previous messageGo to next message
Raj.C.
Messages: 3
Registered: March 2001
Junior Member
CONCAT returns char1 concatenated with char2. This function is equivalent to the concatenation operator "||".

-Thanks
-Raj.C.
Re: Urgent Urgent ! [message #373154 is a reply to message #373143] Fri, 30 March 2001 00:14 Go to previous message
Balamurugan.R
Messages: 91
Registered: March 2001
Member
Hi,

The major difference between concat and ||

operator is concat function concatenates only

two strings into one whereas || operator

concatenates any number of strings into one.

This is the major difference between the two.

Hope this will helps to u.

Cheers,
Balu
Previous Topic: Exchange and Looking for Oracle 8i STS and ILT software
Next Topic: Re: Concatenation operator
Goto Forum:
  


Current Time: Mon Dec 23 05:49:39 CST 2024