Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Distinct pulling data from next column

Status
Not open for further replies.

charanch

Programmer
Jan 3, 2004
55
US
This is a weird one. I have a sql 2000 table with telephone billings from sept-oct. When I execute the following statement, I get the time column mixed in with the phone number column. When I remove the word distinct from the query, I get only the phone numbers. What's up with that? I checked the data many times just to make sure there were only phone numbers in the phone number column and it's all correct and accurate.
Code:
SELECT DISTINCT ([Phone Number])
FROM Oct212004
When DISTINCT is removed, only the phone numbers are returned, just like it's supposed to be. I've used GROUP BY, and IS NOT NULL, I've exhausted my ideas. Any thoughts? Thanks.
 
Man, that is really weird. Sorry, I have no idea why it might do that, but the folks over in the SQL Server forum -- forum193 -- might well.
 
Hey, thanks for that tip. I'll check over there. Thanks again.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top