Skip to main content

All Questions

Filter by
Sorted by
Tagged with
6 votes
3 answers
45k views

Alternative query to this (avoid DISTINCT)

Note: I work with MSSQL 2008, but I guess it's valid for many others DB engines I have this table "Users": UserID User CountryID 1 user 1 1 2 user 2 2 3 user 3 3 4 user 4 ...
Allende's user avatar
  • 247
1 vote
1 answer
2k views

Is my case statement broken by the use of outer apply?

I'm struggling with a case statement not working. Simple enough I need to supply a value of 0 where the question marks are. I have several other case statements which handle separate columns, but this ...
BZN_DBer's user avatar
  • 180