A message from our CEO about the future of Stack Overflow and Stack Exchange. Read now.

New answers tagged

0

Good research! I had (have!) trouble deleting replicate Articles with SQLserver 2012 (11.0.3000.0) after a server rename. That in turn does not allow me some table operations, notably truncate. fwiw, Hein.


1

You should be able to get it by using an OUTER APPLY join plus TOP 1 select * from righttable r where (r.race=1 and r.program = 'gold') or r.race is null order by case when r.race is null then 1 else 0 end returns: commission | program | race ---------: | :------ | ---: 14 | gold | 1 23 | gold | null ...


Top 50 recent answers are included