SELECT Id, Subject ,What.type, WhatID FROM Event Where What.Type IN('Account', 'Opportunity')