I have a result set as shown below which i get after executing union of two queries.
myuser val john 10 kim 20 ekij 30 john 60 kim 45 ekij 30
I want my final reult to be like this sum after grouping by name.
kim 65 ekij 60
What i did was used a derived table.
val) from (
my query 2
) mytable group by mytable.
but result is not as expected it gives same out put as query1
Output of Union query
john 10 kim 20 ekij 30 john 60 kim 45 ekij 30