See:

http://www.mysql.com/doc/P/r/Problems_with_alias.html

Gurhan


-----Original Message-----
From: Massimo Colurcio [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 29, 2002 5:09 PM
To: mySQL List
Subject: Alias & WHERE


It seems I cannot use an alias in WHERE clause, but I can use it in ORDER
BY.

An examples:

this doesn't work
SELECT field1 AS ABC, field2 AS XXX, field3 AS QQQ FROM mytable WHERE ABC =
'abc' ORDER BY ABC

this works
SELECT field1 AS ABC, field2 AS XXX, field3 AS QQQ FROM mytable WHERE
field1 = 'abc' ORDER BY ABC

Why I cannot use the alias 'ABC' in WHERE clause and I can use it in ORDER
BY clause?

I'm using mySQL 3.23.47 on W98 with ODBC (myODBC 3.51.02).

TIA,
Massimo.

_______________________________________
Massimo Colurcio
mailto:[EMAIL PROTECTED]
http://www.softhor.com/developmentarea
ICQ #96413649
ATIC #1219
SONORK 100.10862


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail
<[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to