Quantcast
Channel: SQL Server Database Engine forum
Viewing all articles
Browse latest Browse all 5123

Selecting Max Value from Huge Table

$
0
0

Dear Proffessionals

I have a huge table (20,000,000+ records) with the following columns:

[Time], [User], [Value]

The values in [Value] column can recur for a single User at a Time e.g.

2015-01-01, Me, X

2015-01-01, Me, Y

2015-01-01, Me, X

2015-01-02, Me, Z

2015-01-02, Me, X

2015-01-02, Me, Z

For each day, and for every user I want to have the maximum recurring value :

2015-01-01, Me, X

2015-01-02, Me, Z

to be inserted into another table.

PS: I want the MOST optimized way of achieving this functionality, bcause I am expecting a growth on the raw table over time, so PERFORMANCE is of great consideration.

I would really appreciate it, if somebody can help me.

Regards


Viewing all articles
Browse latest Browse all 5123

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>