-1

I have a sql table with sql_varient column. 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

udaya726
  • 1,010
  • 6
  • 21
  • 41

3 Answers3

3

To get the row for column sql_varient_column is not null and not empty:

SELECT *
from Table
WHERE NULLIF(sql_varient_column, '') IS NOT NULL
Eric
  • 5,675
  • 16
  • 24
2

Try this one:

  SELECT * FROM Table Where sql_varient_column != ''
User Learning
  • 3,165
  • 5
  • 30
  • 51
0

I think you want this.

you can try it

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