Find addresses shared by more than one customer_id where customer_name is is distinct I need to return the list of addresses that have more than one customer_ID associated with them, exclude the customer_IDs that have the same customer_name and return the number of time the address repeats 

Here is what the data looks like:

CUSTOMER_ID   |   CUSTOMER_NAME   |   ADDRESS           | MEMBER_SINCE
----------------------------------------------------------------------
A1000         |      John Doe     |    123 West Lane    |  2/23/2005

A1001         |      John Doe     |    123 West Lane    |  9/30/2005

A1002         |      Tom White    |    456 East Street  |  5/7/2006

A1003         |      Frank Smith  |    123 West Lane    |  12/12/2006

A1004         |      Lisa Simpson |    456 East Street  |  7/19/2007

A1005         |      Clark Kent   |    700 North Ave.   |  2/23/2008

A1006         |      Darth Vader  |    123 West Lane    |  9/29/2008

A1007         |      John Doe     |    456 East Street  |  5/23/2007

A1008         |      Bart Star    |    456 East Street  |  4/19/2006


I want the result set to look like:

CUSTOMER_ID   |   CUSTOMER_NAME   |   ADDRESS           | MEMBER_SINCE| COUNT
--------------------------------------------------------------------------------
A1000         |      John Doe     |    123 West Lane    |  2/23/2005  |  3

A1002         |      Tom White    |    456 East Street  |  5/7/2006   |  4

A1003         |      Frank Smith  |    123 West Lane    |  12/12/2006 |  3

A1004         |      Lisa Simpson |    456 East Street  |  7/19/2007  |  4

A1006         |      Darth Vader  |    123 West Lane    |  9/29/2008  |  3

A1007         |      John Doe     |    456 East Street  |  5/23/2007  |  4

A1008         |      Bart Star    |    456 East Street  |  4/19/2006   |  4


The result shows the CUSTOMER_IDs, CUSTOMER_NAMES, ADDRESSES, MEMBER_SINCE and the COUNT of distinct CUSTOMER_IDs that share the address, while ignoring the rows that have same ADDRESS and CUSTOMER_NAME as another row even though the CUSTOMER_ID is different.  Any ADDRESSES that do not have more than one CUSTOMER_ID are also excluded.

Notice that CUSTOMER_ID A1001 is absent in the result since the CUSTOMER_NAME and ADDRESS are the same and must be a duplicate, and A1005 is absent since there are no other customers with that address.

This is the start:

SELECT
  CUSTOMER_ID as CUSTOMER_ID,
  "CUSTOMER_NAME" as CUSTOMER_NAME,
  "ADDRESS",
  "MEMBER_SINCE",
  count(CUSTOMER_ID) as COUNTER
FROM CUSTOMER_TABLE
  group by ADDRESS_ID, CUSTOMER_ID, CUSTOMER_NAME
  having 
  count(CUSTOMER_ID)&gt;1 
  order by CUSTOMER_ID; 


But I can't manage to take out the duplicate CUSTOMER_NAMES.

This is my first post here and it is very late for me, so I apologize in advance if I didn't post the question correctly.

AR
The query above groups by ADDRESS, CUSTOMER_ID and CUSTOMER_NAME. Since CUSTOMER_ID is unique, the output will have 1 row for each CUSTOMER_ID.

This query gives the correct result: 

SELECT
    CUSTOMER_ID = MIN(ct.CUSTOMER_ID)
    , ct.CUSTOMER_NAME
    , ct. ADDRESS
    , MEMBER_SINCE = MIN(ct.MEMBER_SINCE)
    , cnt.c
FROM CUSTOMER_TABLE ct
INNER JOIN (
    SELECT ADDRESS, COUNT(DISTINCT CUSTOMER_NAME) as c
    FROM CUSTOMER_TABLE 
    GROUP BY ADDRESS 
    HAVING COUNT(ADDRESS) &gt; 1
) as cnt ON cnt.ADDRESS = ct.ADDRESS
GROUP BY ct.ADDRESS, ct.CUSTOMER_NAME, cnt.c
ORDER BY MIN(ct.CUSTOMER_ID); 


It should group by ADDRESS andCUSTOMER_NAMEonly and pick one of theCUSTOMER_IDandMEMBER_SINCE. I choose theMIN(value)` here.

Since you also need the count of distinct CUSTOMER_ID with similar ADDRESS, it has been added to a subquery.

Result:

CUSTOMER_ID | CUSTOMER_NAME | ADDRESS           | MEMBER_SINCE              | COUNT
A1000       | John Doe      | 123 West Lane     | 2005-02-23 00:00:00.000   | 3
A1002       | Tom White     | 456 East Street   | 2006-05-07 00:00:00.000   | 4
A1003       | Frank Smith   | 123 West Lane     | 2006-12-12 00:00:00.000   | 3
A1004       | Lisa Simpson  | 456 East Street   | 2007-07-19 00:00:00.000   | 4
A1006       | Darth Vader   | 123 West Lane     | 2008-09-29 00:00:00.000   | 3
A1007       | John Doe      | 456 East Street   | 2007-05-23 00:00:00.000   | 4
A1008       | Bart Star     | 456 East Street   | 2006-04-19 00:00:00.000   | 4


Note that I don't have access to SAP-Hana. However it seems to be pretty standard SQL and with query should work on most RDBMS.