将信息从一个表应用到同一数据库中的另一个表? [英] Applying Information from one table to a separate table in same database?

查看:81
本文介绍了将信息从一个表应用到同一数据库中的另一个表?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个表1,其中包含邮政编码及其位置信息(即经度,纬度等),表2包含具有其地址的属性...我需要在表1中连接邮政编码的经度和纬度到表2中的地址>>

I have TABLE 1 that contains zip codes and their location information (i.e longitude, latitude, etc), TABLE 2 contains the properties with their addresses... I need to connect the longitude and latitude of the zipcodes in the TABLE 1 to the addresses in TABLE 2 >>

能够创建一个搜索,该搜索给出特定邮政编码的(x)英里半径内最接近的属性...

to be able to create a search that gives the nearest properties in a (x)mile radius of a specific zip code...

我不确定该怎么做.我需要合并两个表吗?还是我可以同时从两者中提取信息的搜索?

I'm not sure how to do this. Do I need to combine the two tables? Or can I do a search that pulls info from both simultaneously?

谢谢!

推荐答案

首先,您需要在这两个表之间建立关系,可以使用Zipcode,也可以使用代理键.然后,您可以将两个表连接起来进行搜索.

First of all, you need to build relatinship between these two tables, you can use Zipcode, or you can use surrogate key. Then you can join the two table to do search.

这篇关于将信息从一个表应用到同一数据库中的另一个表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆