简体   繁体   English

从sql_varient列获取非空数据

[英]Get the non empty data from a sql_varient column

I have a sql table with sql_varient column. 我有一个带有sql_varient列的sql表。 I want to query the table to get the records which has value. 我想查询表以获取具有价值的记录。 I used following query 我使用以下查询

SELECT *
from Table
WHERE sql_varient_column IS NOT NULL

But its return the data which has no data also. 但是它也返回没有数据的数据。 How can I achieve this 我该如何实现

To get the row for column sql_varient_column is not null and not empty: 要获取列sql_varient_column的行不为null且不为空:

SELECT *
from Table
WHERE NULLIF(sql_varient_column, '') IS NOT NULL

试试这个:

  SELECT * FROM Table Where sql_varient_column != ''

I think you want this. 我想你想要这个。

you can try it 你可以试试

SELECT *
from Table
WHERE ISNULL(sql_varient_column,'') != ''

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM