There are a LOT of different SQLs fired when exporting a Staffing profile to Excel. It's basically done 100% in java code using internal PPM APIs, some of which do call some SQL. All the results of these queries are put in a dedicated java object which is then sent to an Excel template to generate the exported staffing profile (I'm talking about PPM 9.3X here).
If you really want to see the list of all SQL queries that are run when exporting the Staffing Profile to Excel, you can enable the debug console (ALT + Click on the logo on the top of the screen if the server parameter SHOW_DEBUG_CONSOLE_PER_USER is set to true), then open the staffing profile, export it to Excel, and in DB Stat menu of the debug console (on the top right), check the SQL that are fired for the request to /itg/staffing/ExportStaffingProfileToExcel.do . On my test environment, I have 120 SQL fired (37 uniques), but your results might vary.
Thank you for your help on this. Reason behind looking for a query is because to add some more additional fields for the staffing profile export data. It seems it is not possible to edit those queries as those are all internally bind with wrappers, objects etc....
I have built a query to print as same like as staffing profile export.