Click here to Skip to main content
15,867,568 members

The Weird and The Wonderful

   

The Weird and The Wonderful forum is a place to post Coding Horrors, Worst Practices, and the occasional flash of brilliance.

We all come across code that simply boggles the mind. Lazy kludges, embarrassing mistakes, horrid workarounds and developers just not quite getting it. And then somedays we come across - or write - the truly sublime.

Post your Best, your worst, and your most interesting. But please - no programming questions . This forum is purely for amusement and discussions on code snippets. All actual programming questions will be removed.

 
GeneralRe: Does NULL <> 'string'? Pin
Dan Sutton13-Jul-17 4:06
Dan Sutton13-Jul-17 4:06 
GeneralRe: Does NULL <> 'string'? Pin
User 1106097913-Jul-17 4:51
User 1106097913-Jul-17 4:51 
GeneralRe: Does NULL <> 'string'? Pin
Dan Sutton13-Jul-17 8:14
Dan Sutton13-Jul-17 8:14 
PraiseRe: Does NULL <> 'string'? Pin
User 1106097913-Jul-17 8:34
User 1106097913-Jul-17 8:34 
GeneralRe: Does NULL <> 'string'? Pin
Richard Deeming13-Jul-17 8:08
mveRichard Deeming13-Jul-17 8:08 
GeneralRe: Does NULL <> 'string'? Pin
Dan Sutton13-Jul-17 8:15
Dan Sutton13-Jul-17 8:15 
GeneralRe: Does NULL <> 'string'? Pin
Rob Grainger22-Jul-17 23:49
Rob Grainger22-Jul-17 23:49 
GeneralRe: Does NULL <> 'string'? Pin
Richard Deeming11-Jul-17 8:58
mveRichard Deeming11-Jul-17 8:58 
It's simple three-valued Boolean logic - what's the problem?! Laugh | :laugh:

Chris Maunder wrote:
IsNull(TableTwo.StringColumn, '') <> 'value'

Except that's not SARGabale.
SQL
WHERE 
    TableTwo.StringColumn Is Null 
Or
    TableTwo.StringColumn != 'value'

(You can remove TableTwo.TableTwoID Is Null, because if that's true, TableTwo.StringColumn will also be Null.)



"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer


GeneralRe: Does NULL <> 'string'? Pin
Chris Maunder11-Jul-17 9:04
cofounderChris Maunder11-Jul-17 9:04 
GeneralRe: Does NULL <> 'string'? Pin
Richard Deeming11-Jul-17 9:09
mveRichard Deeming11-Jul-17 9:09 
JokeRe: Does NULL <> 'string'? Pin
User 1106097913-Jul-17 8:45
User 1106097913-Jul-17 8:45 
GeneralRe: Does NULL <> 'string'? Pin
Richard Deeming13-Jul-17 9:44
mveRichard Deeming13-Jul-17 9:44 
GeneralRe: Does NULL <> 'string'? Pin
User 1106097913-Jul-17 10:16
User 1106097913-Jul-17 10:16 
GeneralRe: Does NULL <> 'string'? Pin
Richard Deeming13-Jul-17 10:35
mveRichard Deeming13-Jul-17 10:35 
GeneralRe: Does NULL <> 'string'? Pin
User 1106097913-Jul-17 10:58
User 1106097913-Jul-17 10:58 
GeneralRe: Does NULL <> 'string'? Pin
Richard Deeming11-Jul-17 9:08
mveRichard Deeming11-Jul-17 9:08 
GeneralRe: Does NULL <> 'string'? Pin
Jeremy Falcon11-Jul-17 9:20
professionalJeremy Falcon11-Jul-17 9:20 
PraiseRe: Does NULL <> 'string'? Pin
TheGreatAndPowerfulOz11-Jul-17 9:37
TheGreatAndPowerfulOz11-Jul-17 9:37 
GeneralRe: Does NULL <> 'string'? Pin
Jörgen Andersson11-Jul-17 11:11
professionalJörgen Andersson11-Jul-17 11:11 
GeneralRe: Does NULL <> 'string'? Pin
Jeremy Falcon11-Jul-17 9:17
professionalJeremy Falcon11-Jul-17 9:17 
GeneralRe: Does NULL <> 'string'? Pin
TheGreatAndPowerfulOz11-Jul-17 9:38
TheGreatAndPowerfulOz11-Jul-17 9:38 
GeneralRe: Does NULL <> 'string'? Pin
Chris Maunder11-Jul-17 9:52
cofounderChris Maunder11-Jul-17 9:52 
GeneralRe: Does NULL <> 'string'? Pin
TheGreatAndPowerfulOz11-Jul-17 10:00
TheGreatAndPowerfulOz11-Jul-17 10:00 
GeneralRe: Does NULL <> 'string'? Pin
Erick Mattew11-Jul-17 10:17
Erick Mattew11-Jul-17 10:17 
GeneralRe: Does NULL <> 'string'? Pin
Jeremy Falcon11-Jul-17 10:58
professionalJeremy Falcon11-Jul-17 10:58 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.