What I need to have the statement do is:
- From the name, output duplicate data with the earliest date.
For example:
If there is mich.edu with date 4/2/2012 and mich.edu with date 4/1/2012, I want the statement to only output mich.edu 4/1/2012
Here is my statement:
echo "select name, reported_at from nodes where reported_at < curdate() or reported_at is null;" | mysql dashboard
Current Output:
name reported_at
ngsghsdfg.edu 2012-03-23 03:40:04
wasdfas.edu 2012-03-05 17:42:03
cnadfafg.uiowa.edu NULL
qwerqwer.edu 2012-03-19 17:03:03
qwerqwre.edu 2012-03-30 20:04:02
qewrqwre.uiowa.edu 2012-03-24 16:10:02
qwerqewr.edu 2012-03-23 22:12:05
qwrewqreq.uiowa.edu NULL
qwerwqer.edu 2012-04-01 04:18:05
adfgnafg.edu 2012-03-27 18:21:01
adsfasf.edu NULL
Sounds like you need the
min()aggregate function: