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

c++ - Delete matches in OpenCV (Keypoints and descriptors) -

java - Could not locate OpenAL library -

sorting - opencl Bitonic sort with 64 bits keys -