You need to "concatenate" the values.

In DB2, you use ||.  In SQL Server you use +.

SELECT col1 || col2 AS newCol
SELECT col1 + col2 AS newCol

I'm not sure about MySQL, but it should be similar.

You might also find a CONCAT() database function with unlimited
arguments:

SELECT CONTACT(col1, col2, coln) AS newCol

m!ke

-----Original Message-----
From: Rick Faircloth [mailto:[EMAIL PROTECTED] 
Sent: Monday, May 19, 2008 11:30 AM
To: CF-Talk
Subject: How to combine multiple fields into one alias?

Hi, all...

How do I combine multiple fields into one alias in my SQL (MySQL 5)?

E.g.,

select remarks_01, remarks_02, remarks_03, remarks_04 as remarks

That would give me remarks_04 an alias of "remarks".  How do I combine
all the remarks into one alias?

Or should I do that in the value attribute in my insert query?

value='#get_data.remarks_01# #get_data.remarks_02# #get_data.remarks_03#
#get_data.remarks_04#'

???

Thanks,

Rick

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;192386516;25150098;k

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:305628
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to