SELECT u.*, ui.* FROM users u JOIN usersInfo ui ON u.userId=ui.userId WHERE u.firmId=1542 AND ui.languageId=2 ORDER BY u.type, u.userId