Would something like this work to get all your firebase users?
http://community.retool.com/t/get-all-users-stored-inside-of-firebase-auth/3076
Once you get all the users, then you should be able to use the Query JSON with SQL as a solution.
Let me know if you have any questions