|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Need to eliminate dupes sharing first 10 digits
Need to eliminate dupes sharing first 10 digits, but keep the highest valued entry.
IE: 8001234567 800123456701 800123456702 900345678901 900345678903 .... From just these 5 entries, I would like to just get these results: 800123456702 900345678903 Thanks, and I appreciate any help/information ![]() |
|
#2
|
|||
|
|||
|
Quote:
This seems a little contrived..... homework assignment perchance? Given my suspicions Ill just give a few clues as to how Id approach this. Look at the MAX and substring functions and group by clause. The simplest way I can think of would return two rows, the shared 10 digits, and the full maximum value You could put the two row returning query inside another to return just the part you want. |
|
#3
|
|||
|
|||
|
select max group by left(col1,10)
|
![]() |
| Viewing: Dev Shed Forums > Databases > MS SQL Development > Need to eliminate dupes sharing first 10 digits |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|