There is no simple SQL command to do this since the information you desire is stored within each project's schema. So you would have to run the query for each project. Maybe a better way is to use the SiteAdmin API or OTA API to get the users and roles for a project, then iterate through all projects in the domain.
This thread has some example code to do that. You can also look in the API reference docs for code.