查询问题.关于sql关联查询。谢谢
我想实现这样的效果
users table
id work_no username
1 222 aaa
2 ccc bbbb
hotel table
id name recommend
1 haha yes
2 xixi no
orderlist table
id hotel(hotel id ) userid(users id ) updatetime status
1 1 2 2003-5-6 4
2 1 1 2003-6-6 5
orderlist table 中status 为4时候为noding 5的时候为normal
需要得到这样的结果
月份 名次 姓名 业绩(员工预定总次数) recommend noding normal 合计
次数 次数 次数 总次数-前面几项
请教高手解决。谢谢