Thanks buddy, I'll give that a go this afternoon and let you know how I get
on.

Rob

-----Original Message-----
From: Coldfusion [mailto:[EMAIL PROTECTED] 
Sent: 05 March 2007 11:01
To: CF-Talk
Subject: RE: M$SQL: Treat two columns as one

Close.. Try this:

Select Col1 + Col2 as 'ColCombined' 
from MyTable 
WHERE Col1 LIKE '%foo%'
ORDER BY ColCombined

-----Original Message-----
From: Robert Rawlins [mailto:[EMAIL PROTECTED] 
Sent: Monday, March 05, 2007 4:47 AM
To: CF-Talk
Subject: M$SQL: Treat two columns as one

Hello Guys,

I'm looking to pull a set of records from the database but treat two of the
columns as one, I'll also need to GROUP BY on that combined column, so
somthing like this.

SELECT Col1 & Col2 AS ColCombined
FROM MyTable
WHERE Col1 LIKE '%foo%'
GROUP BY ColCombined

Does that make sense? Basicly this is a single string that is split when its
entered into the database and needs to be combined on its way out. They are
also pulled from the database as seperate entities on a regular basis in a
different query, thats why they're split on the way in.

If this isnt possible then i'll just build in another 'combined' column into
the database, but i'd rather avoid that duplication.

Thanks guys,

Rob





~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Macromedia ColdFusion MX7
Upgrade to MX7 & experience time-saving features, more productivity.
http://www.adobe.com/products/coldfusion

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

Reply via email to