Click here to Skip to main content
15,919,931 members
Home / Discussions / Database
   

Database

 
Questionsp_change_users_login 'problems' Pin
AlterD22-Aug-07 19:21
AlterD22-Aug-07 19:21 
AnswerRe: sp_change_users_login 'problems' Pin
AlterD22-Aug-07 20:40
AlterD22-Aug-07 20:40 
Questionusing replace function, Please help Pin
SharonRao22-Aug-07 18:14
SharonRao22-Aug-07 18:14 
AnswerRe: using replace function, Please help Pin
John-ph22-Aug-07 22:31
John-ph22-Aug-07 22:31 
AnswerRe: using replace function, Please help Pin
edukulla22-Aug-07 23:27
edukulla22-Aug-07 23:27 
GeneralRe: using replace function, Please help Pin
John-ph23-Aug-07 0:11
John-ph23-Aug-07 0:11 
GeneralRe: using replace function, Please help Pin
edukulla23-Aug-07 2:58
edukulla23-Aug-07 2:58 
QuestionMark duplicate records in a Select Pin
digsy_22-Aug-07 13:50
digsy_22-Aug-07 13:50 
I have a requirement to mark duplicate records when I pull them from the database.

However, I only want to mark the 2nd, 3rd, 4th etc record - not the first one.

The code I have below creates a column called Dupes but marks all the duplicates - including the first one.

Is there a way to only mark the 2nd, 3rd, 4th etc record ?


SELECT *, cs.CallStatusDescription as CSRStatusDesc, cs2.CallStatusDescription as CustomerStatusDesc, (Select MAX(CallAttemptNumber)From CallResults cr Where cl.Id = cr.CallLogId) as CallAttemptNumber,

Dupes = (select count(id)
from CallLogs
where (CustomerHomePhone != '' AND cl.CustomerHomePhone = CustomerHomePhone)
OR (CustomerBusinessPhone != '' AND cl.CustomerBusinessPhone = CustomerBusinessPhone)
AND DealerId= 'hdsh'
AND CSRStatus IS NULL
and datediff(d, logdate, getdate()) <= 21),

FROM CallLogs cl
left Join CallStatus cs on cs.Id = cl.CSRstatus
left Join CallStatus cs2 on cs2.Id = cl.Customerstatus
Where SaleStage IN ('1', '2', '3', '4', '5', '6') And (LogProcessFlag = 1 Or LogProcessFlag = 0)
And DealerId='hdsh'
And Logdate Between '08/01/2007' And '08/31/2007'
AnswerRe: Mark duplicate records in a Select [modified] Pin
John-ph22-Aug-07 20:39
John-ph22-Aug-07 20:39 
QuestionNeed suggestions to Implement a project to track all metrics Pin
sudhirs2222-Aug-07 11:30
sudhirs2222-Aug-07 11:30 
QuestionReplication "transaction with update subscriber" Pin
Assaf8222-Aug-07 10:51
Assaf8222-Aug-07 10:51 
AnswerRe: Replication "transaction with update subscriber" Pin
DLM@TD14-Sep-07 12:17
DLM@TD14-Sep-07 12:17 
QuestionConcat in SQL query Pin
Tom Wright22-Aug-07 8:04
Tom Wright22-Aug-07 8:04 
AnswerRe: Concat in SQL query Pin
Rocky#22-Aug-07 20:19
Rocky#22-Aug-07 20:19 
Questionmigrating t-sql to pl/sql for an existing project Pin
helpfulguy22-Aug-07 6:10
helpfulguy22-Aug-07 6:10 
AnswerRe: migrating t-sql to pl/sql for an existing project Pin
Mycroft Holmes22-Aug-07 23:24
professionalMycroft Holmes22-Aug-07 23:24 
Questionhow to display data in a listbox? Pin
Rharzkie22-Aug-07 3:16
Rharzkie22-Aug-07 3:16 
AnswerRe: how to display data in a listbox? Pin
Rocky#22-Aug-07 20:21
Rocky#22-Aug-07 20:21 
GeneralRe: how to display data in a listbox? Pin
Rharzkie22-Aug-07 21:26
Rharzkie22-Aug-07 21:26 
GeneralRe: how to display data in a listbox? Pin
Rocky#22-Aug-07 21:35
Rocky#22-Aug-07 21:35 
GeneralRe: how to display data in a listbox? Pin
Rharzkie22-Aug-07 21:41
Rharzkie22-Aug-07 21:41 
GeneralRe: how to display data in a listbox? Pin
Rharzkie22-Aug-07 21:43
Rharzkie22-Aug-07 21:43 
GeneralRe: how to display data in a listbox? Pin
Rocky#22-Aug-07 21:49
Rocky#22-Aug-07 21:49 
GeneralRe: how to display data in a listbox? Pin
Rharzkie22-Aug-07 21:51
Rharzkie22-Aug-07 21:51 
QuestionInvalid Cursor Pin
Programm3r22-Aug-07 1:17
Programm3r22-Aug-07 1:17 

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.