Click here to Skip to main content
15,886,110 members
Home / Discussions / Database
   

Database

 
QuestionHow to simplify the query Pin
BalasubramanianK7-Jul-08 1:01
BalasubramanianK7-Jul-08 1:01 
AnswerRe: How to simplify the query Pin
ChandraRam7-Jul-08 3:09
ChandraRam7-Jul-08 3:09 
Questionhow to write "connection string" in namespace or webconfig file ? Pin
sacr837-Jul-08 0:29
sacr837-Jul-08 0:29 
AnswerCross post Pin
dan!sh 7-Jul-08 0:37
professional dan!sh 7-Jul-08 0:37 
Questiondifference between sql server 2000 and 2005, Pin
Shaik Haneef7-Jul-08 0:06
Shaik Haneef7-Jul-08 0:06 
Questionhow to find string match in any updated columns in a trigger Pin
P. S. Pundeer6-Jul-08 19:18
P. S. Pundeer6-Jul-08 19:18 
AnswerRe: how to find string match in any updated columns in a trigger Pin
Giorgi Dalakishvili6-Jul-08 22:00
mentorGiorgi Dalakishvili6-Jul-08 22:00 
QuestionOptimizing query [modified] Pin
Puneri6-Jul-08 2:43
Puneri6-Jul-08 2:43 
Hello,

I have written following query.
select em.ticketid, em.tickettitle, em.handlerid, em.CUSTOMERID, em.departmentid, em.site, em.platform, 
em.server, em.swrelease, em.generateddate, em.emergencyraiseddate, em.startdate, em.enddate, em.problemdesc, 
em.rootcause, em.customerimpact, em.outageevidence, em.isfirsttime, em.workdone, em.techanalysis, 
em.plannedaction, em.permanentfix, em.attid, e.EMPNAME, dept.DEPARTMENTNAME, cust.CNAME from emergencycallup em, 
employee e, department dept, customer cust where em.DEPARTMENTID = '1' and em.handlerid ='test.emp' and 
em.handlerid = e.empid and cust.customerid = em.customerid and dept.departmentid = em.departmentid


But this retrieves same row multiple times. If I simplify this to,
select em.ticketid, em.tickettitle, em.handlerid, em.CUSTOMERID, em.departmentid, em.site, em.platform, 
em.server, em.swrelease, em.generateddate, em.emergencyraiseddate, em.startdate, em.enddate, em.problemdesc, 
em.rootcause, em.customerimpact, em.outageevidence, em.isfirsttime, em.workdone, em.techanalysis, 
em.plannedaction, em.permanentfix, em.attid from emergencycallup em where em.DEPARTMENTID = '1' and em.handlerid 
='test.emp'  


one record is retrieved only once. But here I'm loosing some details such as name.
How to modify this query so that I retrieve all data but records are not duplicated.

TIA,
Puneri

modified on Sunday, July 6, 2008 9:30 AM

QuestionRe: Optimizing query Pin
Puneri6-Jul-08 3:34
Puneri6-Jul-08 3:34 
AnswerRe: Optimizing query Pin
Kjetil Svendsen6-Jul-08 21:34
Kjetil Svendsen6-Jul-08 21:34 
Questionscript Pin
rezarafiee6-Jul-08 2:15
rezarafiee6-Jul-08 2:15 
AnswerRe: script Pin
Saksida Bojan6-Jul-08 3:26
Saksida Bojan6-Jul-08 3:26 
AnswerRe: script Pin
Pete O'Hanlon6-Jul-08 9:14
mvePete O'Hanlon6-Jul-08 9:14 
QuestionEmail Alert after Insert on table Pin
obarahmeh5-Jul-08 21:42
obarahmeh5-Jul-08 21:42 
AnswerRe: Email Alert after Insert on table Pin
N a v a n e e t h6-Jul-08 4:15
N a v a n e e t h6-Jul-08 4:15 
GeneralRe: Email Alert after Insert on table Pin
obarahmeh6-Jul-08 23:52
obarahmeh6-Jul-08 23:52 
GeneralRe: Email Alert after Insert on table Pin
N a v a n e e t h7-Jul-08 0:38
N a v a n e e t h7-Jul-08 0:38 
QuestionOleDb INSERT statement, works if I do NOT prepare it, fails if I do... Pin
kfrankinmn5-Jul-08 20:57
kfrankinmn5-Jul-08 20:57 
AnswerRe: OleDb INSERT statement, works if I do NOT prepare it, fails if I do... Pin
Kjetil Svendsen6-Jul-08 22:22
Kjetil Svendsen6-Jul-08 22:22 
GeneralRe: OleDb INSERT statement, works if I do NOT prepare it, fails if I do... Pin
kfrankinmn7-Jul-08 2:06
kfrankinmn7-Jul-08 2:06 
GeneralRe: OleDb INSERT statement, works if I do NOT prepare it, fails if I do... Pin
Kjetil Svendsen7-Jul-08 21:01
Kjetil Svendsen7-Jul-08 21:01 
QuestionUpdate transaction makes no changes to database Pin
Nigel Mackay5-Jul-08 20:52
Nigel Mackay5-Jul-08 20:52 
QuestionOracle InstantClient Pin
Muammar©5-Jul-08 19:41
Muammar©5-Jul-08 19:41 
QuestionSQL Server 2005 and vb.net >>>> Connection String Pin
kindman_nb5-Jul-08 12:37
kindman_nb5-Jul-08 12:37 
AnswerRe: SQL Server 2005 and vb.net >>>> Connection String Pin
N a v a n e e t h5-Jul-08 16:44
N a v a n e e t h5-Jul-08 16:44 

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.