1
我使用MySQL
是我的表名为npstable独特的人得分月
pk id | score | personid | date
---------------------------------------
435 | 4 | 33 | 2012-01-05
436 | 10 | 78 | 2012-01-21
437 | 5 | 22 | 2012-05-11
438 | 2 | 33 | 2012-01-22
439 | 10 | 22 | 2012-05-25
440 | 4 | 33 | 2012-02-05
我想这些人的得分一样,我想
pk id | score | personid | date
---------------------------------------
435 | 4 | 33 | 2012-01-05
436 | 10 | 78 | 2012-01-21
437 | 10 | 22 | 2012-05-25
440 | 4 | 33 | 2012-02-05
谁没有在同一个月得分
我已经使用查询与我这样的其他要求
“select * from npstable where date_created> ='2012-01-01'AND date_created < ='2012-06-05'AND AND BETWEEN 0 A ND 10;“
任何想法如何使选择查询,可以生成我所需的报告。
使用SELECT DISTINCT(得分)版本,看看这篇文章 - > http://stackoverflow.com/questions/5967130/mysql-select-one-column-distinct-with-corresponding-other-columns – SerhatCan
重复http://stackoverflow.com/questions/16979136/mysql- select-distinct-records-from-latest-dates-only – ahruss
检查ou你的需求输出。你认为最后一行是正确的吗? –