H*M 发帖数: 1268 | 1 write in ANSI SQL only.
you are given two tables:
Table A:
IDA(int) x(double) y(double) correlatedIDB(int)
1 1.0 2.0
2 2.1 3.3
Table B:
IDB(int) x(double) y(double)
1 1.1 2.1
2 2 3
3 10 15
find the cloest ID in table B for each row in A and update the value in Tabl
e A.
by closest, it means min(sqr(A.x-B.x) + sqr(A.y-B.y)).
Therefore,
The correlatedIDB of the first row in Table A should be 1
The co |
|