INSERT INTO t_vol_user
(idpersona,account,password,disable,tirocini)
SELECT p.id, REPLACE(LOWER(CONCAT(p.nome,'.',p.cognome)),' ','.'), '4448dd9a39ab97e1', 0, 1
FROM a_volontari AS vol
INNER JOIN a_anapersone AS p ON (vol.idpersona=p.id AND vol.idcontatto=p.idcontatto AND p.id!=1 AND p.id!=2)
ORDER BY p.cognome, p.nome, vol.pin;