Click here to Skip to main content
15,893,588 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All,
I have a table column of type varchar, which contains data in string like (yes,No..etc) and float data like (10.15,10,1,5...etc). I want to select only those rows which has float values.

please suggest a sql query or any inbuilt sql function.


Thanks..
Posted
Updated 24-Oct-13 2:08am
v2

Use ISNUMERIC[^]. From this link,
The following example uses ISNUMERIC to return all the postal codes that are not numeric values.
SQL
USE AdventureWorks2012;
GO
SELECT City, PostalCode
FROM Person.Address
WHERE ISNUMERIC(PostalCode)<> 1;
GO
Change the query based on your requirement.
 
Share this answer
 
 
Share this answer
 
Try this:

SELECT columnname FROM table WHERE columnname not like '%[^0-9]%'
 
Share this answer
 
v2
select floatcolumn from tablename
 
Share this answer
 
Comments
Umashankar Yadav 24-Oct-13 9:16am    
Thanks to all..

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900