sql server 2005 - how to take unique values in sql -


select distinct customerid, adress left join b on a.customerid=b.customerid  points > 15 

so after gives me result customerids , adresses, incase customer may have 2 ids, example or has twice registered, address same.

how can take unique values adress, adress unique, if there 2 different ids have same adress sql has leave 1 value.

please help!

select adress, max(a.customerid) left join b on a.customerid=b.customerid points > 15 group adress 

Comments

Popular posts from this blog

python - Scipy curvefit RuntimeError:Optimal parameters not found: Number of calls to function has reached maxfev = 1000 -

c# - How to add a new treeview at the selected node? -

java - netbeans "Please wait - classpath scanning in progress..." -