[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Columns alias ?
> > > > I haven`t read the book, but I`m almost certain that this is
> > > >untrue. Aliases work fine for me.
> > >
> > > Table aliases work fine. Do you have an example that doesn't provoke
> > > an error with a column alias?
> >
> > does this give you an error? SELECT something some FROM table order by
> > some;
>
> There is no WHERE clause is your example.
I must apologies here. I didn`t get the point at first, I thought you
were talking about alias problems with ORDER BY. Yes, with WHERE clause
you actually can`t use the aliases. However, there`s another way to do
it. You could use HAVING instead of WHERE, eg. SELECT something as some
FROM yourtable HAVING some='somethingelse'; This thing actually works,
however, when using something like this, here`s bold text from the
manual: Don't use HAVING for items that should be in the WHERE clause. But
all in one, you decide. I think I would definately use HAVING here unless
someone can explain me in detail, why not?
Cheers
Siim Einfeldt
--
---------------------------------------------------------------------
Please check "http://www.mysql.com/documentation/manual.php" before
posting. To request this thread, e-mail mysql-thread60379@xxxxxxxxxxxxxxx
To unsubscribe, send a message to:
<mysql-unsubscribe-treed=ultraviolet.org@xxxxxxxxxxxxxxx>
If you have a broken mail client that cannot send a message to
the above address (Microsoft Outlook), you can use:
http://lists.mysql.com/php/unsubscribe.php
This mailing list archive is a service of Copilot Consulting.