Subj : Re: Generating an Index To : comp.programming From : Willem Date : Thu Sep 08 2005 07:44 am Mary wrote: ) Hi, I need some assistance with a query. To be honest, I'm not even ) sure it can be done. It can't be done. ) I have a table that contains around 100,000 records. For the sake of ) this discussion, assume just two columns: ) ) ID Data ) 1 000000000000 ) 2 010000000000 ) 3 011111111111 ) 4 101100011101 ) 5 110100011011 ) 6 111100000000 ) 7 111100000111 ) 8 111100010111 ) 9 111100011011 ) 10 111111111111 ) ) ) ) ... ) ) My aim is to somehow sort the data (by creating a third column) so that ) the records are in order of "string distance" or similar. In other ) words, so that similar strings are located next to (or as close as ) possible to) each other. There is no 'order' to 'string distance'. Moving some strings that are similar closer to each other will move other strings that are similar away from each other. Your problem is not solvable. SaSW, Willem -- Disclaimer: I am in no way responsible for any of the statements made in the above text. For all I know I might be drugged or something.. No I'm not paranoid. You all think I'm paranoid, don't you ! #EOT .