You create aliases.  cfquery with SQL Server and MS Access both support the
SQL aliasing.

e.g.

select column as columnAlias

This becomes handy when you use aggregate functions.

e.g.

select sum(column) as columnSum

The aliases are picked up from cfquery and cfstoredproc.

Teddy

On 11/17/06, Dave Francis <[EMAIL PROTECTED]> wrote:
>
> But this IS expected behaviour.
> If you use * to grab all columns in all tables, how do you propose to get
> the results where the column names are the same, but the values are
> different?
>
>
> -----Original Message-----
> From: Bud [mailto:[EMAIL PROTECTED]
> Sent: Friday, November 17, 2006 3:03 PM
> To: CF-Talk
> Subject: RE: Queries adding table Alias to column name
>
>
> The point is. This isn't expected behavior. The driver isn't supposed
> to make up names. I'd alias the column myself if I wanted that. I've
> never ever seen this. I see many people using just * to grab all the
> fields in all the tables in a query. When you need all the fields, *
> is faster than specifying all the field names. Faster to type and the
> query runs faster.
>
>
> >What's changed about it? Anyway, Why can't you just exclude it from one
> of
> >the tables like you said. My guess is that they are identical values
> every
> >time anyway. Why have it in there twice?
> >
> >
> >..:.:.:.:.:.:.:.:.:.:.:.
> >Bobby Hartsfield
> >http://acoderslife.com
> >
> >
> >
> >
> >
> >-----Original Message-----
> >From: Bud [mailto:[EMAIL PROTECTED]
> >Sent: Friday, November 17, 2006 8:13 AM
> >To: CF-Talk
> >Subject: Queries adding table Alias to column name
> >
> >ARRGGHH!! Is this a CF issue or an Access database driver issue?
> >
> >http://azarflooringgallery.com/bud.cfm
> >
> >This is a very simple, and quite standard query.
> >
> >SELECT M.*,C.*
> >FROM Main_Categories M LEFT OUTER JOIN Categories C on
> >M.Main_Category_ID = C.Main_Category_ID
> >
> >Note the Main_Category_ID is being returned with the alias in it's
> >name. The field is actually named Main_Category_ID
> >
> >C.Main_Category_ID and M.Main_Category_ID
> >
> >I'm getting the error Variable MAIN_CATEGORY_ID is undefined.
> >
> >I can get it to go away, but only if I manually enter all field names
> >and exclude Main_Category_ID from one of the tables.
> >
> >Why would someone change the behavior of something so drastically?
> >This will be affecting code everywhere.
> >--
> >
> >Bud Schneehagen - Tropical Web Creations, Inc.
> >
> >_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
> >Web Based Solutions / eCommerce Development & Hosting
> >http://www.twcreations.com/ - http://www.cf-ezcart.com/
> >Toll Free: 877.207.6397 - Local & Int'l Phone/Fax: 386.789.0968
> >
> >
> >
> >
>
>
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting,
up-to-date ColdFusion information by your peers, delivered to your door four 
times a year.
http://www.fusionauthority.com/quarterly

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:260944
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