By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,334 Members | 2,776 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,334 IT Pros & Developers. It's quick & easy.

How to check if the data in the field is decimal using sql sysntax?

Exequiel
100+
P: 287
I have bunch of data in the table in my database, the field is in a varchar type, the field has deimal numbers, has integers, has letters etc. i only want to check if the data in that field is a decimal, how can i check that using only mysql syntax? no php.

Any comment are so apprecitaed, thank you. :)
Aug 13 '15 #1
Share this Question
Share on Google+
3 Replies


Rabbit
Expert Mod 10K+
P: 12,359
Look for a dot in the string in addition to whether it's numeric.
Aug 13 '15 #2

Exequiel
100+
P: 287
@rabbit how can i code it into mysql?
Aug 14 '15 #3

Rabbit
Expert Mod 10K+
P: 12,359
You could use the regexp operator
Aug 14 '15 #4

Post your reply

Sign in to post your reply or Sign up for a free account.