Details for users whose custom user field value is above average field value Report

This query generates a list of users who have a value for a custom field which is above the average of that value for all users.

SELECT people.name, people.emails.email, people.custom_data[#] 

FROM people 

WHERE people.custom_data[#] > (SELECT AVG(people.custom_data[#]) FROM people) 

Here we use a sub-query in the WHERE clause to find an average of the field.

We are then able to use our query to SELECT against that data we have found, so the query will output user details for users where this value is above Zero.

Helpful Unhelpful

1 of 2 people found this page helpful

Add a comment

You need to log in before you can submit a comment.

Need a password reminder?