I have a table in which there are two columns. One column is id and the other is value. When I try to retrieve the data that is not empty it gives me unwanted error. I have to apply join to some tables as well. My query is something like this SELECT count(DISTINCT ID) FROM Tbl inner join tbl1 on tbl.id=tbl1.id WHERE id IN(1,2,3) and value!=''.But it also resturns the values that are empty. Can anyone help. Thanks in advance.