Thanks for your reply Stefan,
I think I have spotted why the results is difference when sorting some fields.
For example under Users.
When i sort Company Name (billing_company) some of the companies do not have a Company Name. It seems that when i sort company name and search in the search-field for users only rows with company name filled will be available to search in? Can that make sense? Only 2 of all 7 administrators have company billing set.
Filering for role “Administrator” when sorting is set to sort company billing.
Returns 2 rows.
SELECT SQL_CALC_FOUND_ROWS wp_29ca8b97d3_users.ID
FROM wp_29ca8b97d3_users
INNER JOIN wp_29ca8b97d3_usermeta
ON ( wp_29ca8b97d3_users.ID = wp_29ca8b97d3_usermeta.user_id )
INNER JOIN wp_29ca8b97d3_usermeta AS acsort_usermeta
ON wp_29ca8b97d3_users.ID = acsort_usermeta.user_id
AND acsort_usermeta.meta_key = ‘billing_company’
AND acsort_usermeta.meta_value <> ”
WHERE 1=1
AND ( ( ( wp_29ca8b97d3_usermeta.meta_key = ‘wp_29ca8b97d3_capabilities’
AND wp_29ca8b97d3_usermeta.meta_value LIKE ‘%\”administrator\”%’ ) ) )
ORDER BY CAST( acsort_usermeta.meta_value AS CHAR ) ASC, wp_29ca8b97d3_users.ID ASC
LIMIT 0, 25
Filtering when sorting is not set.
Return 7 rows
SELECT SQL_CALC_FOUND_ROWS wp_29ca8b97d3_users.ID
FROM wp_29ca8b97d3_users
INNER JOIN wp_29ca8b97d3_usermeta
ON ( wp_29ca8b97d3_users.ID = wp_29ca8b97d3_usermeta.user_id )
WHERE 1=1
AND ( ( ( wp_29ca8b97d3_usermeta.meta_key = ‘wp_29ca8b97d3_capabilities’
AND wp_29ca8b97d3_usermeta.meta_value LIKE ‘%\”administrator\”%’ ) ) )
ORDER BY user_registered DESC
LIMIT 0, 25
Any change of changing this, so when sorting by billing company, all administrators shows, with admins without billing company shows in order below companies with filled in company name?
Hope this make sense and you understand my questions :)
Best
Svein Magne