Link to home
Start Free TrialLog in
Avatar of sam2929
sam2929

asked on

Not getting unique records

I have values like
id         date          code
0001      20110729123425      aaa
0001      20110729205634      aaa

i just want to pick up last date to make record distict

i am doing

select max(date) ,id, code from table aa
group by id.code


it should give me distinct
0001      20110729205634      aaa but i getting both records

date is chracter 14

Avatar of Aaron Tomosky
Aaron Tomosky
Flag of United States of America image

select max(date) ,id, code from table aa
group by id, code

Unless your . Was a mistype
ASKER CERTIFIED SOLUTION
Avatar of Aloysius Low
Aloysius Low
Flag of Singapore image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial