我有3个mysql表(order,camp和user),其值如下:
order_table
ID camp_id orderDate message
1 1 2015-01-01 ok
2 1 2015-02-01 ok
3 2 2015-03-01 not ok
4 3 2015-01-01 not ok
5 1 2015-04-01 not ok
6 2 2015-01-01 ok
7 3 2015-07-01 not ok
camp_table
camp_id camp_uid camp name
1 10 first camp
2 11 second camp
3 12 third camp
4 10 forth camp
user_table
uid uname
10 abc
11 xyz
12 wrt
我希望你能把结果呈现如下:
以下是需要翻译的内容:
uname,camp name,message
针对每个用户,从订单表中获取今天的最后2条记录,按照订单日期排序。
我希望连接这些表格,以便从用户表中获取“用户名”,从营地表中获取“营地名称”,并从订单表中获取“消息”。 按照订单日期,以今天的顺序排序。 谢谢。