Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2003
    Location
    baltimore, MD
    Posts
    2

    Unanswered: Identify duplicate zip code + 4 digits zip

    Hi, all
    If I have two columns, zip_cd and zip_4_cd, and I want to check for any records with identical zip_cd and zip_4_cd, how would I do that? I've tried different ways but I still can't figure it out...
    Some attempts:

    SELECT sum(COUNT(DISTINCT ZIP_CD))
    FROM table name
    group by zip_4_CD

    select count(zip_4_cd))
    from table_name
    where zip_cd=
    (select min(zip_cd)
    from table_name
    group by zip_cd)

  2. #2
    Join Date
    Aug 2003
    Location
    West
    Posts
    101

    Re: Identify duplicate zip code + 4 digits zip

    SELECT
    COUNT(ZIP_CD + ZIP_4_CD) AS Expr1,
    ZIP_CD + ZIP_4_CD AS Expr2
    FROM table name
    GROUP BY ZIP_CD + ZIP_4_CD



    Originally posted by K. Lo
    Hi, all
    If I have two columns, zip_cd and zip_4_cd, and I want to check for any records with identical zip_cd and zip_4_cd, how would I do that? I've tried different ways but I still can't figure it out...
    Some attempts:

    SELECT sum(COUNT(DISTINCT ZIP_CD))
    FROM table name
    group by zip_4_CD

    select count(zip_4_cd))
    from table_name
    where zip_cd=
    (select min(zip_cd)
    from table_name
    group by zip_cd)

  3. #3
    Join Date
    Sep 2003
    Location
    baltimore, MD
    Posts
    2

    Cool thanks for the help

    but zip_cd and zip_4_cd are two different columns.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •