views:

73

answers:

0

Hello

SELECT ka.id, ka.user 
  FROM {auctions} ka 
 WHERE (SELECT MAX(inst) 
          FROM (SELECT SUM(installment) AS inst 
                  FROM {payback} kp 
                 WHERE id IN (SELECT id 
                                FROM {auctions}
                               WHERE user = ka.user) 
              GROUP BY scheduleDate) as t1) > 1000

I'm trying to select auctions whose maximum installment for a given scheduleDate is bigger than 1000.

"user warning: Unknown column 'ka.user' in 'where clause'"

How to make it work?