Click here to Skip to main content
15,895,370 members
Home / Discussions / Database
   

Database

 
AnswerRe: how can I make the value of an attribute in a table as SYSDATE Pin
Wendelius10-Oct-08 19:48
mentorWendelius10-Oct-08 19:48 
QuestionLeft JOIN Pin
polishprogrammer10-Oct-08 5:57
polishprogrammer10-Oct-08 5:57 
AnswerRe: Left JOIN Pin
Tim Carmichael10-Oct-08 6:08
Tim Carmichael10-Oct-08 6:08 
GeneralRe: Left JOIN Pin
polishprogrammer10-Oct-08 6:28
polishprogrammer10-Oct-08 6:28 
GeneralRe: Left JOIN Pin
Tim Carmichael10-Oct-08 6:55
Tim Carmichael10-Oct-08 6:55 
GeneralRe: Left JOIN Pin
polishprogrammer10-Oct-08 8:31
polishprogrammer10-Oct-08 8:31 
GeneralRe: Left JOIN Pin
Tim Carmichael10-Oct-08 8:33
Tim Carmichael10-Oct-08 8:33 
QuestionRe: Left JOIN Pin
polishprogrammer13-Oct-08 6:07
polishprogrammer13-Oct-08 6:07 
Tim,

I don't know if you're still paying attention to this thread, but this is what I tried based on your advice:

SELECT Details.*, Results.VE
FROM Details LEFT JOIN [SELECT Results.VE, Results.SerialNumber, Max(Results.ID) From Results Group By Results.VE, Results.SerialNumber]. AS Results ON Details.SN = Results.SerialNumber);


It worked for the most part, but there were 7 more records in this result table from this query than are present in the 'LEFT' table. I scanned through the result table to find the duplications and it seems that the duplications were instances in the 'RIGHT' table where more than one record was present for the object stored in the left table.

As I mentioned Friday, there can be more than one process result in the RIGHT table for the object stored in the LEFT table, but I only want the latest process result. In most cases, this query eliminates the duplicate process results, but if there were two process results with different VE data, then it seems the subquery in the following query returns both records. If you could help me understand why, I would appreciate it. Thanks.


SELECT Details.*, Results.VE
FROM Details LEFT JOIN [SELECT Results.VE, Results.SerialNumber, Max(Results.ID) From Results Group By Results.VE, Results.SerialNumber]. AS Results ON Details.SN = Results.SerialNumber);
AnswerRe: Left JOIN Pin
Tim Carmichael13-Oct-08 9:49
Tim Carmichael13-Oct-08 9:49 
GeneralRe: Left JOIN Pin
polishprogrammer13-Oct-08 11:07
polishprogrammer13-Oct-08 11:07 
AnswerRe: Left Outter JOIN Pin
David Mujica10-Oct-08 6:19
David Mujica10-Oct-08 6:19 
GeneralRe: Left Outter JOIN Pin
polishprogrammer10-Oct-08 6:47
polishprogrammer10-Oct-08 6:47 
Questionsql hierarchal data retrieval Pin
sana1710-Oct-08 5:11
sana1710-Oct-08 5:11 
AnswerRe: sql hierarchal data retrieval Pin
Wendelius10-Oct-08 6:40
mentorWendelius10-Oct-08 6:40 
GeneralRe: sql hierarchal data retrieval Pin
sana1710-Oct-08 6:53
sana1710-Oct-08 6:53 
GeneralRe: sql hierarchal data retrieval Pin
Wendelius10-Oct-08 6:58
mentorWendelius10-Oct-08 6:58 
GeneralRe: sql hierarchal data retrieval Pin
Giorgi Dalakishvili10-Oct-08 8:36
mentorGiorgi Dalakishvili10-Oct-08 8:36 
GeneralRe: sql hierarchal data retrieval Pin
sana1711-Oct-08 4:27
sana1711-Oct-08 4:27 
QuestionPerformance Issue in Query Pin
ashwanigl10-Oct-08 4:18
ashwanigl10-Oct-08 4:18 
AnswerRe: Performance Issue in Query Pin
Ashfield10-Oct-08 4:29
Ashfield10-Oct-08 4:29 
GeneralRe: Performance Issue in Query Pin
ashwanigl10-Oct-08 4:32
ashwanigl10-Oct-08 4:32 
GeneralRe: Performance Issue in Query Pin
Ashfield10-Oct-08 4:45
Ashfield10-Oct-08 4:45 
GeneralRe: Performance Issue in Query Pin
Mycroft Holmes11-Oct-08 0:39
professionalMycroft Holmes11-Oct-08 0:39 
QuestionSQL Server 2000 to SQL Server 2005 Pin
amit201110-Oct-08 3:54
amit201110-Oct-08 3:54 
AnswerRe: SQL Server 2000 to SQL Server 2005 Pin
Ashfield10-Oct-08 4:31
Ashfield10-Oct-08 4:31 

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.