Quantcast
Channel: Planet MySQL
Viewing all articles
Browse latest Browse all 18782

How to Find Out if an Entire String Is Numeric

$
0
0
Problem: Find out if an entire string is numeric.  (Just like the is_numeric function in php.) Problem, Part II: Most online resources show how you can find out if part of your string is numeric. Solution: SELECT str FROM tbl   WHERE str REGEXP('(^[0-9]+$)');Give it a whirl! For those who would like to view some test results, here goes: mysql> SELECT str FROM tbl; +-----+ | str | +-----+ |
PlanetMySQL Voting: Vote UP / Vote DOWN

Viewing all articles
Browse latest Browse all 18782

Trending Articles