我有两个表,我想获取最后一个输入日期。无法获取列表用户的最大日期php MYSQL
The first table is seeker:
seeker_nic-----username
111-------------ali
222-------------umer
333-------------raza
The second one is requestblood:
id-------seeker_nic-----requireddate
1------- 111 ----------2012/10/9
2 ------- 222-----------2012/5/8
3 ------ 111-----------2012/12/12
4 ------- 111-----------2012/11/12
5---------111-----------2012/09/09
6 ------- 222-----------2012/7/9
7 ------- 333 ----------2012/4/4
现在,我想与他们的最后日期插入像列表中的用户..
s.no---- username----- requireddate
1------- ali---------- 2012/09/09
2------- umer--------- 2012/7/9
3------- raza--------- 2012/4/4
当我运行在phpMyAdmin此查询我使用这个查询
SELECT seeker.username,bloodrequest.requireddate,
max(bloodrequest.bloodrequest_id) AS maxdate
FROM seeker
JOIN bloodrequest ON seeker.seeker_nic = bloodrequest.seeker_nic
GROUP BY seeker.username
。 。它列出所有用户,并显示每个用户的第一个插入日期..但我想最后插入的日期...我该怎么做..请我需要帮助:(
为什么有些日期“2012/5/8”和其他“2012/09/09”?格式不一致。 – Jakub 2012-04-11 20:32:17
这些是搜索引擎插入日期..但我想显示上次插入日期列出所有用户时 – maham 2012-04-11 20:36:04