🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.interbase.sql
5 messages
5 total messages Started by DP Fri, 20 Dec 2002 15:35
Combining varchars to return one varchar
#11074
Author: DP
Date: Fri, 20 Dec 2002 15:35
17 lines
1224 bytes
Hello

Rather than doing :

  Select title, fname, lname
    from contacts

what's the correct syntax for doing something like this:

    select (title+' '+fname+' '+lname) as fullname
     from contacts

I'm assuming the above is not correct.

TIA

David
Re: Combining varchars to return one varchar
#11075
Author: Jeff Overcash (TeamB)
Date: Fri, 20 Dec 2002 15:43
34 lines
1908 bytes

DP, -'#-bigfoot.com> wrote:
> 
> Hello
> 
> Rather than doing :
> 
>   Select title, fname, lname
>     from contacts
> 
> what's the correct syntax for doing something like this:
> 
>     select (title+' '+fname+' '+lname) as fullname
>      from contacts
> 
> I'm assuming the above is not correct.
> 

    select (title || ' ' || fname || ' ' || lname) as fullname
     from contacts

> TIA
> 
> David

-- 
Jeff Overcash (TeamB) 
      (Please do not email me directly unless  asked. Thank You) 
Maybe it was infatuation or the thrill of the chase.
Maybe you were always beyond my reach and my heart was playing safe.
But was that love in your eye I saw or the reflection of mine?
Give me time, won't you give me that time!
Welcome back to the circus.            (Fish)
Thanks. nm
#11077
Author: DP
Date: Fri, 20 Dec 2002 15:51
38 lines
1971 bytes

"Jeff Overcash (TeamB)" <jeffovercash@mindspring.com> wrote in message
news:3E033A99.1FF3AA44@mindspring.com...
>
>
> DP, -'#-bigfoot.com> wrote:
> >
> > Hello
> >
> > Rather than doing :
> >
> >   Select title, fname, lname
> >     from contacts
> >
> > what's the correct syntax for doing something like this:
> >
> >     select (title+' '+fname+' '+lname) as fullname
> >      from contacts
> >
> > I'm assuming the above is not correct.
> >
>
>     select (title || ' ' || fname || ' ' || lname) as fullname
>      from contacts
>
> > TIA
> >
> > David
>
> --
> Jeff Overcash (TeamB)
>       (Please do not email me directly unless  asked. Thank You)
> Maybe it was infatuation or the thrill of the chase.
> Maybe you were always beyond my reach and my heart was playing safe.
> But was that love in your eye I saw or the reflection of mine?
> Give me time, won't you give me that time!
> Welcome back to the circus.            (Fish)
Re: Thanks. nm
#11078
Author: Martijn Tonies
Date: Fri, 20 Dec 2002 16:05
33 lines
1845 bytes
> > > Rather than doing :
> > >
> > >   Select title, fname, lname
> > >     from contacts
> > >
> > > what's the correct syntax for doing something like this:
> > >
> > >     select (title+' '+fname+' '+lname) as fullname
> > >      from contacts
> > >
> > > I'm assuming the above is not correct.
> > >
> >
> >     select (title || ' ' || fname || ' ' || lname) as fullname
> >      from contacts

Do note that if one of the columns is NULL, the result ends
up being NULL as well.


--

With regards,

Martijn Tonies
InterBase Workbench - the developer tool for InterBase & Firebird
Firebird Workbench - the developer tool for Firebird
Upscene Productions
http://www.upscene.com

"This is an object-oriented system.
If we change anything, the users object."
Re: Thanks. nm
#11080
Author: DP
Date: Fri, 20 Dec 2002 17:25
4 lines
1164 bytes
> Do note that if one of the columns is NULL, the result ends
> up being NULL as well.

Ah!
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads