I have a situation... i have these columns - table X
Product Number LastEditDate GUID
A 0 14.12.16 A1
A 0 10.12.16 A2
B 0 10.12.16 A3
B 0 13.12.16 A4
C 0 13.12.16 A5
C 0 14.12.16 A6
Now, i need to put Number 1 to all products where the Date is the Max. I was using this query:
update X set Number=0;
update X set Number=1 where LastEditDate in (select Max(LastEditDate) from X Group by Product);
So this will give me something like this:
Product Number LastEditDate
A 1 14.12.16
A 0 10.12.16
B 0 10.12.16
B 1 13.12.16
C 0 13.12.16
C 1 14.12.16
But, with my query, i have: 1;0;0;1;1;1; because 13.12.16 will be in that "select Max(LastEditDate) from X). How to make like that, to have results: 1;0;0;1;0;1;???
Please help!