Take data from SQL Puzzle Lite #2 (see thread183-1197121).
Make result set containing 48 rows and three columns: N (tinyint), State and Capital
1st row (N=2): state/capital closest to two other capitals
2nd row (N=3): state/capital closest to three other capitals
...
repeat until N=49
Criteria "closest" is based on sum of distances. For N=2 example, every city has two nearest cities - but (only) one has minimal sum of distances to nearest two cities and that is... Boston, I think.
Include sum in result set if you want.
Best exec time (measured w/ profiler) wins it all.
Plz no cheating - especially about Hawaii
------
Theory: everybody knows everything, nothing works
Practice: everything works, nobody knows why
![[banghead] [banghead] [banghead]](/data/assets/smilies/banghead.gif)
Make result set containing 48 rows and three columns: N (tinyint), State and Capital
1st row (N=2): state/capital closest to two other capitals
2nd row (N=3): state/capital closest to three other capitals
...
repeat until N=49
Criteria "closest" is based on sum of distances. For N=2 example, every city has two nearest cities - but (only) one has minimal sum of distances to nearest two cities and that is... Boston, I think.
Include sum in result set if you want.
Best exec time (measured w/ profiler) wins it all.
Plz no cheating - especially about Hawaii
------
Theory: everybody knows everything, nothing works
Practice: everything works, nobody knows why
![[banghead] [banghead] [banghead]](/data/assets/smilies/banghead.gif)