Query to filter users by sign-up 'custom fields'

None of the above queries will give you exactly what you are looking for. Without writing a new query, the best approach would be to run the first query I posted multiple times. Run it one time for each of your custom fields. Enter the field’s name into the query’s field_name input. The query I’m referring to is this one:

--[params]
-- string :field_name

WITH ucf_name AS(
SELECT
CONCAT('user_field_', id) AS name
FROM user_fields
WHERE name = :field_name
)

SELECT
u.id AS user_id,
ucf.value
FROM users u
JOIN user_custom_fields ucf
ON ucf.user_id = u.id
WHERE ucf.name = (SELECT name FROM ucf_name)