home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.databases.ms-sqlserver      Notorious Rube Goldberg contraption      19,505 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 18,259 of 19,505   
   Henk van den Berg to Erland Sommarskog   
   Re: Help needed to write a qury   
   25 Apr 11 16:29:39   
   
   From: hvandenberg@xs4all.nl   
      
   On 25-04-2011 15:31, Erland Sommarskog wrote:   
   > Erland Sommarskog (esquel@sommarskog.se) writes:   
   >> Thanks for the sample data!   
   >>   
   >> I see that I had forgot the join condition on EmpId - without the query is   
   >> kind of meaningless.   
   >>   
   >> The principle is simple: number the rows, and then make a self-join on   
   >> the row number with the next number.   
   > JOIN   numbered b ON b.rowno = a.rowno +1   
   >                   AND b.EmpId = a.EmpId   
      
   Yes, that was what I had in mind as well. Just didn't manage to put it   
   all together.   
      
   Thanks, Henk   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca