Subject: | Re: Checking for duplicates
| Date: | Fri, 20 May 2016 14:55:52 +1000
| From: | Tom Krieg <invalid@nodomain.tv>
| Newsgroups: | pnews.paradox-client_server
|
Never mind. I just went through this again after writing it all down and
there is an obvious error in my logic.
Step 4 should have been:
SELECT foo.locality_uid, COUNT(1) as COUNT
FROM (SELECT DISTINCT address_detail.address_postcode,
address_detail.locality_uid
FROM address_detail) AS foo
GROUP BY foo.locality_uid
HAVING COUNT(1) > 1
I found them all.
On 20/05/2016 2:49 PM, Tom Krieg wrote:
> So we have a number of localities with more than 1 postcode. Now I want
> to determine which ones.
>
> Step 4: Check for duplicate postcodes.
>
> SELECT foo.address_postcode, foo.locality_uid, COUNT(1) as COUNT
> FROM
> (SELECT DISTINCT address_detail.address_postcode,
> address_detail.locality_uid
> FROM address_detail) AS foo
> GROUP BY foo.address_postcode, foo.locality_uid
> HAVING COUNT(1) > 1
> ;
>
> 0 Rows
>
|