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,192 of 19,505   
   Henk van den Berg to Alfaking   
   Re: I Need help with a query...   
   05 Apr 11 11:39:03   
   
   c8450322   
   From: hvandenberg@xs4all.nl   
      
   On 05-04-2011 10:54, Alfaking wrote:   
   > On 5 Apr, 10:09, Henk van den Berg  wrote:   
   >   
   >> Please post the query that you have used.   
   >   
   > SELECT     contr FROM       table1   
   > WHERE     (contr NOT IN   
   > (SELECT     contr   
   > FROM          table1   
   > WHERE      (type = 'T')   
   > GROUP BY contr)   
   >   
   > In my idea this should be ok, but when I double-check the results,   
   > something goes wrong...   
   > no idea why   
      
      
   SELECT DISTINCT contr FROM table1 WHERE type <> 'T'   
   should do the trick   
      
   SELECT contr FROM table1 WHERE type <> 'T' GROUP BY contr   
   as an alternative   
      
   --- 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