【发布时间】:2016-09-15 13:37:52
【问题描述】:
我有 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
今天订单按orderDate
的order_table中每个用户的最后2条记录我想加入这些表,以使 user_table 中的 uname 和 camp_table 中的 camp name 和 order_table 的strong>消息。 今天订单按订单日期 谢谢
【问题讨论】:
-
请编辑并更详细地解释您的问题。
-
您只想从订单故事中获得最后 2 条记录,并且希望我们加入?