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?

2. The 3rd to the last line:

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

   I wanted to say

   diff < -1000

   but mysql also complained.





Thank you,

Joe.



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


select a.family, t.*, p.*, round(p.value - t.amount) as diff
from accounts as a,
transactions as t,
symbols as s,
positions as p
where a.account = p.account
and p.account = t.account
and p.symbol = t.symbol
and s.symbol = p.symbol
and p.date = @maxdate
and t.type = 'BUY'
and t.shares > 100
and t.amount > 3000
and s.type != 'MF'
and (p.value - t.amount) < -1000
order by diff
limit 20;



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

Reply via email to