Adobe Dreamweaver Forums



Last 10 THreads :         Counting in Hex (Last Post : Andrei1 - Replies : 2 - Views : 3 )           »          Trouble with SQL Query Tool on Leopard (Last Post : Daverms - Replies : 1 - Views : 2 )           »          How do I open te files in older versions of Director? (Last Post : Mike Blaustein - Replies : 1 - Views : 2 )           »          Exporting csv or xmal from database (Last Post : Andy - Replies : 0 - Views : 1 )           »          Change html page image by the month (Last Post : Michael White - Replies : 10 - Views : 11 )           »          Beginner help - PUT confusion (Last Post : anynick32 - Replies : 6 - Views : 7 )           »          Flash Player 10 Crash (Last Post : saurabhgsl - Replies : 0 - Views : 1 )           »          Re: LingoWorkshop slider menu (Last Post : openspark - Replies : 0 - Views : 1 )           »          Capture full URL with CF CGI variable (Last Post : Azadi - Replies : 2 - Views : 3 )           »          Centering a site using layers in browser window (Last Post : malcster2 - Replies : 2 - Views : 3 )           »         


Home Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
User Info Statistics
Go Back   Adobe Dreamweaver Forums > Other Macromedia/Adobe Products > Cold Fusion
 
Tags:



Reply
  #1 (permalink)  
Old 10-08-2008, 03:02 PM
simbull
 
Posts: n/a
Diggs:
Default SQL statement - simple

Hi, I know this is simple but I'm being a bit thick

I have these two columns (firstname, lastname) in the same table, I would like
to join them and call it wholeName.

So I thought it was this "SELECT firstname, lastname AS wholeName FROM table"

but it doesn't work.....am I not correct?

Cheers in advance



Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 10-08-2008, 03:31 PM
Ian Skinner
 
Posts: n/a
Diggs:
Default Re: SQL statement - simple

simbull wrote:
> Hi, I know this is simple but I'm being a bit thick
>
> I have these two columns (firstname, lastname) in the same table, I would like
> to join them and call it wholeName.
>
> So I thought it was this "SELECT firstname, lastname AS wholeName FROM table"
>
> but it doesn't work.....am I not correct?
>
> Cheers in advance
>


No you are not correct. You need a concatenation character in there.
What character that is will depend on your database. Here are two very
common ones || and +

I.E.
SELECT firstname || lastname AS wholeName

OR

SELECT firstname + lastname AS wholeName

If this is for display purposes you may want to also concatenate a space
character ' ' into your result.
Reply With Quote
  #3 (permalink)  
Old 10-08-2008, 03:42 PM
simbull
 
Posts: n/a
Diggs:
Default Re: SQL statement - simple

many thanks ian

so I do want a space, so it would be

SELECT firstname + ' ' + lastname AS wholeName

?
Reply With Quote


  #4 (permalink)  
Old 10-08-2008, 04:40 PM
Ian Skinner
 
Posts: n/a
Diggs:
Default Re: SQL statement - simple

simbull wrote:
> many thanks ian
>
> so I do want a space, so it would be
>
> SELECT firstname + ' ' + lastname AS wholeName


Assuming that + is your concatenation character, then yes that is how
you would add a space.

I presume this has worked for you by now.
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



© Camley Interactive (camley.info) 2008 - all logos and images are copywrite their respective owners.
Proud member of the Camley Interactive Network
All times are GMT. The time now is 12:30 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.
Inactive Reminders By Mished.co.uk