hello,
I have and income aggregated table..
which have families repeated for multiple income sources... i want to find sum of that income over total families not repeated...
eg
| NATIONALITY | INCOME TYPE | VALUE | TOTAL FAMILIES |
| 1 | 1 | 1000 | 20 |
| 1 | 2 | 2000 | 20 |
| 1 | 3 | 3000 | 20 |
| 2 | 1 | 1500 | 10 |
| 2 | 2 | 1100 | 10 |
| (1000+2000+3000)/20 for nat 1 |
(1500+1100)/10 for nat 2 and |
| (1000+2000+3000+1500+1100)/(10+20) |
can you help with query to calculate that...
I did it using (with and select distinct)... but can i do it without them.. with only (join,distinct and over)