복붙노트

[SQL] 데이터베이스 내에서 주소 표준화

SQL

데이터베이스 내에서 주소 표준화

MS 액세스 2013 유무에 위치 톤 작업 / 필요 주소를 표준화한다.

예를 들면 같은 주소를 포함 :

당신은 점을 얻는다.

나는 왼쪽 (7) 또는 어떤 문자보다 데이터베이스에 한 번 이상 존재하는 모든 레코드를 끌어 쿼리를 실행 고려했지만, 그 논리에 명백한 결함이있다.

약간 다른 패션에 그 날이 주소를 여러 번 존재할 수있는 기록의 목록을 생성하는 데 유용한 기능이나 쿼리 또는 다른 어떤이 있나요?

해결법

  1. ==============================

    1.이 까다로운 비즈니스 ... 등분 마술과 과학입니다. 당신은 혼자대로의 변화에 ​​깜짝 놀라게 될 것입니다.

    이 까다로운 비즈니스 ... 등분 마술과 과학입니다. 당신은 혼자대로의 변화에 ​​깜짝 놀라게 될 것입니다.

    내가 구글 API를 사용하는 이유입니다. 그것은 시간의 초기 데이터 세트에 대해,이 소요될 수 있습니다,하지만 새로운 해결해야 할 것입니다 추가합니다.

    예를 들면

    https://maps.googleapis.com/maps/api/geocode/json?address=500 S Main St,Providence RI 02903
    

    반환 부분적으로

    "formatted_address" : "500 S Main St, Providence, RI 02903, USA"
    

    그리고 좋은 소식은

    https://maps.googleapis.com/maps/api/geocode/json?address=500 South Main Steet,Providence RI 02903
    

    이전 쿼리와 같은 형식의 주소를 반환

    "formatted_address" : "500 S Main St, Providence, RI 02903, USA"
    

    VBA 예 :

    다음 코드를 실행하면 ...

    ' VBA project Reference required:
    ' Microsoft XML, v3.0
    
    Dim httpReq As New MSXML2.ServerXMLHTTP
    httpReq.Open "GET", "https://maps.googleapis.com/maps/api/geocode/json?address=500 South Main Steet,Providence RI 02903", False
    httpReq.send
    Dim response As String
    response = httpReq.responseText
    

    ... 문자열 변수 응답은 다음과 같은 JSON 데이터를 포함 :

    {
       "results" : [
          {
             "address_components" : [
                {
                   "long_name" : "500",
                   "short_name" : "500",
                   "types" : [ "street_number" ]
                },
                {
                   "long_name" : "South Main Street",
                   "short_name" : "S Main St",
                   "types" : [ "route" ]
                },
                {
                   "long_name" : "Fox Point",
                   "short_name" : "Fox Point",
                   "types" : [ "neighborhood", "political" ]
                },
                {
                   "long_name" : "Providence",
                   "short_name" : "Providence",
                   "types" : [ "locality", "political" ]
                },
                {
                   "long_name" : "Providence County",
                   "short_name" : "Providence County",
                   "types" : [ "administrative_area_level_2", "political" ]
                },
                {
                   "long_name" : "Rhode Island",
                   "short_name" : "RI",
                   "types" : [ "administrative_area_level_1", "political" ]
                },
                {
                   "long_name" : "United States",
                   "short_name" : "US",
                   "types" : [ "country", "political" ]
                },
                {
                   "long_name" : "02903",
                   "short_name" : "02903",
                   "types" : [ "postal_code" ]
                },
                {
                   "long_name" : "2915",
                   "short_name" : "2915",
                   "types" : [ "postal_code_suffix" ]
                }
             ],
             "formatted_address" : "500 S Main St, Providence, RI 02903, USA",
             "geometry" : {
                "bounds" : {
                   "northeast" : {
                      "lat" : 41.82055829999999,
                      "lng" : -71.4028137
                   },
                   "southwest" : {
                      "lat" : 41.8204014,
                      "lng" : -71.40319219999999
                   }
                },
                "location" : {
                   "lat" : 41.8204799,
                   "lng" : -71.40300289999999
                },
                "location_type" : "ROOFTOP",
                "viewport" : {
                   "northeast" : {
                      "lat" : 41.8218288302915,
                      "lng" : -71.40165396970851
                   },
                   "southwest" : {
                      "lat" : 41.8191308697085,
                      "lng" : -71.40435193029151
                   }
                }
             },
             "partial_match" : true,
             "place_id" : "ChIJicPQAT9F5IkRfq2njkYqZtE",
             "types" : [ "premise" ]
          }
       ],
       "status" : "OK"
    }
    
  2. from https://stackoverflow.com/questions/41249742/address-standardization-within-a-database by cc-by-sa and MIT license