Author:
erics, October 2nd, 2015
I needed to automate the addition of new users with a sequential member’s ID in WordPress. Additionally, there were non-numeric entries in that column that had to be ignored. The wp_users.user_login column is a varchar(60) and so does not naturally handle numeric operations well at all. The solution is a combination of REGEXP and cast(): […]
Categories: How-To's, Technology Tags: Cast, Char, Column, Filter, howto, Max, mysql, Numeric, Regex, regexp, select, sort, SQL, tips, Varchar, Where, WordPress
|
No comments
Author:
erics, July 11th, 2013
select theField from theTable order by theField+0; ~OR~ select theField from theTable order by CAST(theField AS UNSIGNED);
Categories: How-To's, Technology Tags: 0, Add, Cast, howto, Number, sort, String, text(), tips, Zero
|
No comments