select * from webmail_servers ws, webmail_user_accounts wm where ws.server_id = wm.server_id and user_id = :user_id order by neat_name, username select count(server_id) as server_count from webmail_user_accounts where user_id = :user_id delete from webmail_user_accounts where account_id = :account_id update webmail_user_accounts set default_p = 'f' where account_id <> :account_id and user_id = :user_id update webmail_user_accounts set default_p = 't' where account_id = :account_id