Joseph Alotta wrote:
greetings,

I know this is pretty basic stuff, but I couldn't find an answer in google.

1. I want to set the @maxdate variable, but mysql complains. What am I doing wrong?

> set @maxdate = select max(date) from positions where account =
> "111200512343222";

select (@maxdate := max(date)) from positions where account = "111200512343222";


2. The 3rd to the last line:

   and (p.value - t.amount) < -1000

   I wanted to say

   diff < -1000

   but mysql also complained.


http://dev.mysql.com/doc/refman/4.1/en/select.html says:
"It is not allowable to use a column alias in a WHERE clause, because the column value might not yet be determined when the WHERE clause is executed. " It is explained further at http://dev.mysql.com/doc/refman/4.1/en/problems-with-alias.html

Regards, Jigal.

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

Reply via email to