Monday, December 29, 2008

Silly mistake I had made :)

I had written code filtering some records out and had assumed that it would produce the result I want. After few minutes I realized that how careless I was; here is a similar implementation that I had done; Assume that we have a table like this: And want to get all records that "value"s are not equal to 0. This was my code: select * from test where [value] != 0 But it should be written like this :). select * from test where isnull([value], -1) != 0 Hope you wont make that mistake.

No comments: