I saw a reference that said standard SQL doesn't allow an alias to be used
in a WHERE clause, but I thought perhaps I'd get an error message. I
understand why, logically, it should be the way it is.

Thanks for the reassurance.

Regards,

Jerry Schwartz
Global Information Incorporated
195 Farmington Ave.
Farmington, CT 06032

860.674.8796 / FAX: 860.674.8341


> -----Original Message-----
> From: Mark Leith [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, January 23, 2007 4:46 PM
> To: Jerry Schwartz
> Cc: mysql@lists.mysql.com
> Subject: Re: Alias a function result?
>
> Jerry Schwartz wrote:
> > I know that you can alias a function result as easily as
> anything else, but
> > I've run into a problem with an application I inherited.
> For reasons too
> > murky to go into, I would like to refer to the result of a
> group function as
> > the name of the argument of the function. Here's an example
> of what I mean:
> >
> > SELECT book_author, GROUP_CONCAT(book_title) AS book_title GROUP BY
> > book_author WHERE book_title LIKE "<something>";
> >
> > This actually seems to work, but it makes me ill to look at
> it. Is this
> > legal, or have I found a loophole that might be closed in
> the future?
> >
>
> Perfectly legal, will not get changed. :)
>
> Cheers,
>
> Mark
>
> --
> Mark Leith, Support Engineer
> MySQL AB, Worcester, England, www.mysql.com
> Are you MySQL certified?  www.mysql.com/certification
>
>
> --
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:
> http://lists.mysql.com/[EMAIL PROTECTED]
>
>




-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to