sql - Oracle combine two rows into one -
i have result this:
15.04.13 5 doe, john 2431 null null 46 560 0 null 0 15.04.13 5 doe, john 2431 paid 525 0 0 585 null 60
this result of union of 2 queries.
what need 1 row per day , person.
what i'm looking way combine these 2 rows like
15.04.13 5 doe, john 2431 paid 525 46 560 585 null 60
ok lets result that:
15.04.13 5 doe, john 2431 null null 46 560 null null 0 15.04.13 5 doe, john 2431 not paid 323 0 0 452 null 55 15.04.13 5 doe, john 2431 paid 525 0 0 585 null 60
i need second , third row , match 46 , 560 first row rows below.
in case group max() won't work. how can solve ?
this sounds job group by
select some_date , some_id , some_name , some_number , max(paid) paid , max(amount) amount , max(etc) etc some_table group some_date , some_id , some_name , some_number
Comments
Post a Comment