RE: Alias & WHERE

2002-05-29 Thread Gurhan Ozen
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 i

Alias & WHERE

2002-05-29 Thread Massimo Colurcio
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 =

Re: Alias & WHERE

2002-05-28 Thread Benjamin Pflugmann
Hi. On Wed, May 29, 2002 at 02:36:11AM +0200, [EMAIL PROTECTED] wrote: > It seems I cannot use an alias in WHERE clause, but I can use it in ORDER > BY. Correct. > An examples: > > this doesnt work > SELECT field1 AS ABC, field2 AS XXX, field3 AS QQQ FROM mytable WHERE ABC = > 'abc' ORDER BY

Alias & WHERE

2002-05-28 Thread Massimo Colurcio
It seems I cannot use an alias in WHERE clause, but I can use it in ORDER BY. An examples: this doesnt 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 =