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,195 of 19,505   
   Henk van den Berg to Alfaking   
   Re: I Need help with a query...   
   05 Apr 11 13:07:44   
   
   ff9ad636   
   From: hvandenberg@xs4all.nl   
      
   Yes, I re-read your question and I found out that I had misinterpreted   
   it. Therefore I canceled my answers.   
      
   Best,   
   Henk   
      
   On 05-04-2011 12:57, Alfaking wrote:   
   > On 5 Apr, 12:13, Henk van den Berg  wrote:   
   >   
   >> If you   
   >>   
   >> SELECT     contr FROM       table1   
   >>    WHERE     (contr  IN   
   >>    (SELECT     contr   
   >>    FROM          table1   
   >>    WHERE      (type<>  'T')   
   >>    GROUP BY contr)   
   >>   
   >> you will get the expected results.   
   >   
   > Not sure about this...   
   > if I   
   >   
   >>    SELECT     contr   
   >>    FROM          table1   
   >>    WHERE      (type<>  'T')   
   >   
   > i get also a number of "contr" where type='T', because of the   
   > different ID (that's the key).   
   > for example, in the results I have also   
   >   
   > 1250 because of the first line of the table...   
   > but that's not correct !!!   
   >   
   >> Still, the simple version is preferable   
   >> SELECT DISTINCT contr FROM table1 WHERE type<>  'T'   
   >   
   > again, wrong results...   
   >   
      
   --- 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