I HAVE TABLE LIKE
SNO NAME MOBILE
1 SHAS 9346353452
2 RAJU NULL
3 VAMSHI 0
4 PRAVEEN 9765432111
I WANT SELECT ONLY WITHOUT NULL AND 0 VALUES IN SQL MOBILE COLOUM
O/P LIKE
SNO NAME MOBILE
1 SHAS 9346353452
4 PRAVEEN 9765432111
Jignesh TrivediPosted Apr 23, 2014, 12:06 AM
you can also try...
Select Mobile from TableName
Where isnull(Mobile,'0') != '0'
hope this will help you.
VulpesPosted Apr 22, 2014, 1:45 PM
If datatype of Mobile column is decimal or int:
Select Mobile from TableName
Where Mobile Is Not Null And Mobile != 0
If datatype of Mobile column is Varchar:
Select Mobile from TableName
Where Mobile Is Not Null And Mobile != '0'
Ranjit PowarPosted Apr 22, 2014, 1:25 PM
If datatype of Mobile column is decimal or int
Select Mobile from TableName
Where Mobile !=0
If datatype of Mobile column is Varchar
Select Mobile from TableName
Where Mobile !='0'