Thursday, 8 August 2013

TABLE 1 data needs to populated to table2 by grouping

TABLE 1 data needs to populated to table2 by grouping

I have
TABLE1
col1 col2 col3
--------------
1 1 1
1 2 1
1 3 1
2 2 2
2 4 2
8 7 2
8 8 3
2 4 3
3 9 3
I have a requirement that i have move data from table 1 to Table 2 by
satisfying requirements
TABLE2
col1 col2 col3
--------------
3 3 1
10 7 2
13 9 3
where values col3 are grouped in such a way that we should sum all the
values of col1 and where as max value of col2 needs to be populated

No comments:

Post a Comment