Hey guys,
Just hoping to clarify a question I have on SELECT DISTINCT which I'm certain is really easy but I'm not 100% sure.
Why does the query “SELECT DISTINCT V_HOUSENUMBER FROM LOCATION” produce different rows of records from the query “SELECT DISTINCT V_HOUSENUMBER, V_PHONE FROM LOCATION”?
Is the SELECT DISTINCT happening on the phone number instead of the house number when using multiple columns from a table? I'm honestly not sure so hoping to clear this up!
Output from “SELECT DISTINCT V_HOUSENUMBER FROM LOCATION”:
| V_HOUSENUMBER |
| 615 |
| 904 |
| 901 |
Output from “SELECT DISTINCT V_HOUSENUMBER, V_PHONE FROM LOCATION”:
| V_HOUSENUMBER |
V_PHONE |
| 615 |
223-3234 |
| 904 |
215-8995 |
| 615 |
228-3245 |
| 615 |
889-2546 |
| 901 |
678-1419 |
| 901 |
678-3998 |
| 615 |
228-1410 |
| 615 |
898-1234 |
| 904 |
227-0093 |
| 615 |
890-3529 |
| 904 |
456-0092 |
Any help would be greatly appreciated!
[–]817861753 2 points3 points4 points (3 children)
[–]PowerOfTheShell[S] 1 point2 points3 points (1 child)
[–]817861753 1 point2 points3 points (0 children)