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 17,748 of 19,505   
   Plamen Ratchev to All   
   Re: Return valuse based on multiple "if    
   06 Feb 10 17:43:46   
   
   97dda0ba   
   From: Plamen@SQLStudio.com   
      
   This should do it:   
      
   SELECT TOP 1 WITH TIES source, price, state   
   FROM #TempTable   
   WHERE source IN ('A', 'B', 'C')   
   ORDER BY source;   
      
   --   
   Plamen Ratchev   
   http://www.SQLStudio.com   
      
   --- 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