在sql中按顺序输入参数值

时间:2014-01-08 16:05:32

标签: sql ms-access

当Access执行cooltable.distance时,我在ORDER BY上获得了输入参数值,这很奇怪,因为距离是cooltable中创建的列。我错过了什么?

SELECT
target_postcodes.target_postcode,
population_postcodes.population_postcode,
cooltable.distance,
SQR( ( Population_postcodes.Longitude - target_postcodes.longitude)^2 + (Population_postcodes.Latitude - target_postcodes.latitude)^2 ) as distance

INTO
cooltable

FROM
Population_postcodes,
Target_postcodes


ORDER BY
cooltable.distance;

1 个答案:

答案 0 :(得分:0)

INSERT INTO CoolTable( col1, col2, col3 )
SELECT .....
FROM ...
WHERE ...