我用到两个表,一个是customer,一个是order
customer表的结构和数据如下
customerId    name
1              李三
2              王五
3              刘六
4              黄七order表的结构和数据如下
orderId   customerId    amount    orderTime
1          1             53        2013-05-31
2          2             100       2013-06-01
3          1             70        2013-06-01
4          2             500       2013-06-02
5          1             200       2013-06-02
6          3             400       2013-06-02
我想查出最近三天()今天,昨天,前天)的消费总额小于500的用户,这个例子里的结果就是customerId    name    total
1              李三    323
3              刘六    400
这个查询句怎么写,多谢!