Sql 如果列类型=image,null不为空,如何获取结果?
我有列名Sql 如果列类型=image,null不为空,如何获取结果?,sql,sql-server,sql-server-2008,Sql,Sql Server,Sql Server 2008,我有列名image,类型-image,空 我希望得到图像不为空的结果 我使用查询: SELECT * FROM Farm f WHERE f.name=2 AND f.colum=12 AND f.image != NULL 但我得到了一个错误: The text, ntext, and image data types cannot be compared or sorted, except when using IS NULL or LIKE operator. 有人知道在图像不为空的
image
,类型-image,空
我希望得到图像
不为空的结果
我使用查询:
SELECT * FROM Farm f WHERE f.name=2 AND f.colum=12 AND f.image != NULL
但我得到了一个错误:
The text, ntext, and image data types cannot be compared or sorted,
except when using IS NULL or LIKE operator.
有人知道在图像不为空的情况下如何得到正确的结果吗?很好,谢谢)我现在不能接受,需要12分钟才能接受答案。很好,谢谢)我现在不能接受,需要12分钟才能接受答案。
SELECT * FROM Farm f WHERE f.name=2 AND f.colum=12 AND f.image IS NOT NULL