I have a table (Well actually a query called ClientSearch) which is for example holds this data:
CUSTOMERID NAME APPLICATIONNO
1001 Bob 5001
1001 Bob 5002
1002 Jane 5003
1003 Fred 5004
1003 Fred 5005
1004 James 5006
The SQL statement I have so far is:
This would get the following records
CUSTOMERID NAME APPLICATIONNO
1001 Bob 5001
1001 Bob 5002
But I only want it to ever show only 1 unique CustomerID, so I don't care which application it chooses pick. So it should show like this:
CUSTOMERID NAME APPLICATIONNO
1001 Bob 5001
I have thought about using the keyword DISTINCT or UNIQUE for example here.. but it doesn't work
CUSTOMERID NAME APPLICATIONNO
1001 Bob 5001
1001 Bob 5002
1002 Jane 5003
1003 Fred 5004
1003 Fred 5005
1004 James 5006
The SQL statement I have so far is:
Code:
SELECT * FROM ClientSearch WHERE CustomerID LIKE "1001"
CUSTOMERID NAME APPLICATIONNO
1001 Bob 5001
1001 Bob 5002
But I only want it to ever show only 1 unique CustomerID, so I don't care which application it chooses pick. So it should show like this:
CUSTOMERID NAME APPLICATIONNO
1001 Bob 5001
I have thought about using the keyword DISTINCT or UNIQUE for example here.. but it doesn't work
Code:
SELECT UNIQUE(CustomerID), Name, ApplicationNo FROM ClientSearch WHERE CustomerID LIKE "1001"