1# your select statement acctually works (and I don't know wich is your statement...).
2# You must replace only
3SELECT ...
4# with
5DELETE [table name or alias]
6# and leave everything else the same.
7
8# e.g:
9DELETE cu FROM CustomUser cu
10left join RoleMapping on cu.id = RoleMapping.principalId
11WHERE RoleMapping.roleId = 1;