How to select all rows where mycolumn is an integer value?

mysql, sql

Solution

SELECT * FROM mytable WHERE mycolumn REGEXP '^[0-9]+$'

Shouldn't that be simple enough?

Problem

What would be a good way to select all the rows from a table where a column is an unsigned integer, for example here is some pseudo-sql ``` SELECT * FROM mytable WHERE mycolumn IS UNSIGNED INTEGER ``` So that strings 'abc' and numbers like '12.3' and '12.0' would not match, but integers like '123' would. Where mycolumn is type text/varchar

Original source

Related problems