Group by multiply rows - HARD
Hi,
NAME | SURNAME| x | y | BIRTH_DAY
KRIS | ONE | 324 | 52 | 2011-09-12
KRIS | SIX | 222 | 111 | 2011-09-13
KRIS | SSS | 1558 | 13 | 2011-09-13
ANNA | DDD | 7486 | 0 | 2011-09-12
TOM | DDD | 4853 | 111 | 2011-09-12
JERRY | DDD | 6402 | 112 | 2011-09-12
JACK | DDD | 957 | 113 | 2011-09-15
JACK | DDD | 11445 | 368 | 2011-09-19
I have problem.
I need to group all this data per name column, so each name needs to have only one row, x must be summed, y must be summed and from surname and birthday column values may be taken randomly. So at the finall I will have one row per one name containig summed values from x and y column and surname and_birthday values may be taken randomly. Examle how it shoul look for KRIS ROW:
KRIS | SIX | 546 | 163 | 2011-09-13
For KRIS SURNAME column value six was taken randomly from ONE and SIX values, x and y was summed and value for BIRTH_DAY column was taken randomly from 2011-09-12 and 2011-09-13 dates.
I have no idea how can I do it.
May I ask you for help?
Edited by: user13520646 on 2011-10-10 09:17