Click here to Skip to main content
15,890,690 members
Home / Discussions / Database
   

Database

 
Questionprocedure and datetime Pin
dexom13-Jan-06 19:37
dexom13-Jan-06 19:37 
AnswerRe: procedure and datetime Pin
PolarbearDK14-Jan-06 4:56
PolarbearDK14-Jan-06 4:56 
AnswerRe: procedure and datetime Pin
Muhammad Javed Khan19-Jan-06 1:29
Muhammad Javed Khan19-Jan-06 1:29 
QuestionThoughts on how to load data... Pin
PolarbearDK13-Jan-06 13:41
PolarbearDK13-Jan-06 13:41 
QuestionSorting using BindingSource with master-detail relationships Pin
kooks2k13-Jan-06 12:48
kooks2k13-Jan-06 12:48 
QuestionADO Item Collection Mystery Pin
mjackson1113-Jan-06 12:22
mjackson1113-Jan-06 12:22 
AnswerRe: ADO Item Collection Mystery Pin
mjackson1114-Jan-06 10:11
mjackson1114-Jan-06 10:11 
Questionremoving "similar duplicates" from select results Pin
jszpila13-Jan-06 5:56
jszpila13-Jan-06 5:56 
Hello everyone,
I'm doing a query for user names and email address from a database. Unfortunately, due to circumstances out of my control, data is poorly/incorrectly formatted and sometimes leads to *mostly* duplicate entries for the same thing.

Example:
SELECT DISTINCT(email), firstname + ' ' + lastname <br />
FROM users <br />
WHERE compdate BETWEEN '1/1/2006' AND '1/31/2006' <br />
AND email IS NOT NULL <br />
AND email <> ' ' <br />
ORDER BY TLH_1_1240


will return the following:
1   test01@test01.com   John Doe
2   test01@test01.com   John T. Doe

As you can see, the email is the same and the name is similar enough, at least for my purposes.

The DISTINCT is obviously working in a way that I don't understand and carrying over to distinct names. I just want distinct email addresses and the name that comes up associated with them first. Your thoughts?

Thanks in advance for your help!

-------------------
abort, retry, fail?

-- modified at 11:57 Friday 13th January, 2006
AnswerRe: removing "similar duplicates" from select results Pin
Michael Potter13-Jan-06 10:49
Michael Potter13-Jan-06 10:49 
GeneralRe: removing &quot;similar duplicates&quot; from select results Pin
jszpila13-Jan-06 10:56
jszpila13-Jan-06 10:56 
QuestionUsing Grant Pin
Tiger45612-Jan-06 23:46
Tiger45612-Jan-06 23:46 
QuestionSQL 2005 ConnectionString Pin
victor_ba8512-Jan-06 20:25
victor_ba8512-Jan-06 20:25 
AnswerRe: SQL 2005 ConnectionString Pin
gharry12-Jan-06 22:12
gharry12-Jan-06 22:12 
AnswerRe: SQL 2005 ConnectionString Pin
jonathan1512-Jan-06 22:50
jonathan1512-Jan-06 22:50 
AnswerRe: SQL 2005 ConnectionString Pin
itoleck13-Jan-06 4:57
itoleck13-Jan-06 4:57 
GeneralRe: SQL 2005 ConnectionString Pin
Paul Conrad14-Jan-06 10:02
professionalPaul Conrad14-Jan-06 10:02 
GeneralRe: SQL 2005 ConnectionString Pin
victor_ba8513-Jan-06 8:04
victor_ba8513-Jan-06 8:04 
GeneralRe: SQL 2005 ConnectionString Pin
jonathan1513-Jan-06 11:10
jonathan1513-Jan-06 11:10 
QuestionError in C# - not making sense Pin
TheJudeDude12-Jan-06 17:08
TheJudeDude12-Jan-06 17:08 
AnswerRe: Error in C# - not making sense Pin
Dave Kreskowiak13-Jan-06 5:28
mveDave Kreskowiak13-Jan-06 5:28 
GeneralRe: Error in C# - not making sense Pin
TheJudeDude13-Jan-06 12:23
TheJudeDude13-Jan-06 12:23 
GeneralRe: Error in C# - not making sense Pin
Dave Kreskowiak13-Jan-06 15:02
mveDave Kreskowiak13-Jan-06 15:02 
GeneralRe: Error in C# - not making sense Pin
TheJudeDude13-Jan-06 15:38
TheJudeDude13-Jan-06 15:38 
QuestionOLTP and Reporting databases seperated? Pin
erdsah8812-Jan-06 10:27
erdsah8812-Jan-06 10:27 
AnswerRe: OLTP and Reporting databases seperated? Pin
Colin Angus Mackay12-Jan-06 11:06
Colin Angus Mackay12-Jan-06 11:06 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.