SQL Server : AND OR statement -


i wrote procedure pull records error table.

it should pull value when error column not null or empty

declare @statementkey int   select distinct      error.errormessage,     row.rownumber,     statement.statementkey,     statement.statementname      statement  join      row row on row.fk_statementkey = statement.pk_statementkey join      errortable error on row.rownumber = error.rownumber       statement.statementkey = @statementkey      , (error.errormessage not null or error.errormessage <> '') 

i did still pulls rows empty errormessage column

but when

and (error.errormessage not null) , (error.errormessage <> '') 

then not pull empty value null

can tell me easier way , maybe tell me why?

thanks guys.

the last , statement in first query incorrect. should replace this:

and not(error.errormessage null or error.errormessage = '') 

Comments

Popular posts from this blog

node.js - How to mock a third-party api calls in the backend -

node.js - Why do I get "SOCKS connection failed. Connection not allowed by ruleset" for some .onion sites? -

matlab - 0-by-1 sym - What do I need to change in order to get proper symbolic results? -