I have the following:
Name Age When
Paul 21 01-Jan-10
Paul 54 01-Jan-11
Paul 65 01-Jan-12
I want to pull out all names and that age wherer the date is >= 01-Jan-11
I ve tried
SELECT NAME, AGE, MIN(When)
FROM ATABLE
WHERE When >= '01-Jan-11'
GROUP BY NAME, AGE
That did not work - I get the 01 Jan 2011 AND 01 Jan 2012 for Paul which is wrong - I just want the one
NOTE: This comment is the most correct so far but does not provide an answer :(
You're where clause will get 2 records and will keep them as 2 records since you're grouping by Name and Age. If Name and Age were the same, it'd be 1 record and not 2.