Ah... missed the title on this. There is no PK on this table, at least not one that you can easily use. I have to admit that I'm a little gob-smacked that no one anticipated the problem of duplicates on a billion row table.
Shifting gears on this, it's difficult for me to understand that out of more than 40 columns, there are no candidate keys. Someone needs to seriously analyze this table and start picking it apart for keys and, maybe, some lookup tables. As a bit of a sidebar, I'd be interested in what the data is in this heap and what people expect to draw from it. Perhaps there's something that we could all glean from such knowledge and, perhaps, even come up with a solution to the original problem of detecting duplicates and doing something about them.
is pronounced "ree-bar
" and is a "Modenism
" for R
First step towards the paradigm shift of writing Set Based code:
________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.
"Change is inevitable... change for the better is not".
"If "pre-optimization" is the root of all evil, then what does the resulting no optimization lead to?"
How to post code problems
How to Post Performance Problems
Create a Tally Function (fnTally)