phpgroupware-developers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Phpgroupware-developers] Contact function for SQL (howto in mssql)


From: Chris Weiss
Subject: Re: [Phpgroupware-developers] Contact function for SQL (howto in mssql)
Date: Fri, 12 Sep 2003 13:15:35 +0000

SELECT RTRIM(ISNULL(last_name,'')) + RTRIM(ISNULL(org_name,'')) + ... as name 
...

The RTRIM is needed to remove any whitespace otherwise you get something like
"name                                                                    orgname
                                                           "



Edgar Luna (address@hidden) wrote:
>
>Hi all specially signurde,
>
>Now that I did the sql classes for phpGroupWare (that generate the
>right sql for each database), people on irc channel have found a
>useful function that could be added.
>
>This is a concat function that allows concatenate strings to NULL, and
>the result be a the string. Afaik, and based on web research, the
>standard says that trying to concatenate something to NULL, the result
>must be NULL. But we found that will be very useful (apart of support
>the standard concatenate), have the other functionality.
>
>Now, for pgsql I know (from Brian Johnson), that I could do:
>
>SELECT COALESCE(last_name,'') || COALESCE(org_name,'') || ... as name ...
>
>and I search for something in mysql and found:
>SELECT CONCAT(IFNULL(last_name,''), IFNULL(org_name,''), ...) as name ...
>
>so the only one missing here is the mssql way. Thats what I asked to
>you help me, I haven't access to this database to try. So if you could
>help me, we could provide this to phpGroupWare developers.
>
>Best regards
>
>





reply via email to

[Prev in Thread] Current Thread [Next in Thread]