Reputation: 341
I have table like
Create table Producttbl ( sno nvarchar(100),sname nvarchar(200),price nvarchar(100))
Values are
sno sname price
1 aaa 1.50
2 ccc 5.30
abc xxx abc
3 dsd kkk
nn dss 5.1
Price column is nvarchar
it accept all kind of data like string or numeric.
From that table, I want to select results like this:
sno sname price
1 aaa 1.50
2 ccc 5.30
Please help me.
Upvotes: 0
Views: 12295
Reputation: 239654
You presumably want sno
values which consist of digits and only digits (otherwise, you need to specify which "numeric" types you wish to accept):
select * from ProductTbl where sno not like '%[^0-9]%'
We use a double negative check, to exclude sno
values which contain a non-digit character.
Upvotes: 2