i have to select Only Users which are community partner Users.How to select them ??what will be the SOQL query for selecting partner Users ?? which field in User profile will tell whether the user is community partner User or not ??
Partner portal users also have access to Community So, it is better to filter a query by Community license:
This will return all users who have a profile with license of community.
List <User> communityUsers = [SELECT id, Name FROM User WHERE Profile.UserLicense.Name='Partner Community' OR Profile.UserLicense.Name='Customer Community'];