suttercain Posted April 17, 2008 Share Posted April 17, 2008 Hi everyone, I have a column that contains NULL, String, Float and Intiger values. Is there away to use a SELECT statement to only pull out the Numbers and Floats (Decimal) ? Thanks. Link to comment https://forums.phpfreaks.com/topic/101617-select-where-column-float-number-or-decimal/ Share on other sites More sharing options...
GingerRobot Posted April 17, 2008 Share Posted April 17, 2008 Not entirely sure why you'd have a need to store all those different types in one column, but regular expressions are you friend: $sql = "SELECT * FROM tbl WHERE field REGEXP '^[0-9.]+$' Link to comment https://forums.phpfreaks.com/topic/101617-select-where-column-float-number-or-decimal/#findComment-519901 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.