Count(*) as rolecount, filter by rolecount = 1 How can i filter out the rows who only got rolecount = 1?
WHERE rolecount = 1 gives an error. Can't really figure out how to do it.

SELECT 
u.uid AS uid,
u.name AS name, 
u.picture AS picture,
n.field_full_name_value AS field_full_name_value,
f.field_function_value AS field_function_value,
pi.field_phone_intern__value AS field_phone_intern__value,
ur.rid AS rid,
COUNT(*) AS rolecount
FROM `dev_drupal_wurth-intranet`.users u 
LEFT OUTER JOIN `dev_drupal_project`.users_roles ur ON u.uid = ur.uid 
LEFT OUTER JOIN `dev_drupal_project`.field_data_field_full_name n ON u.uid = n.entity_id 
LEFT OUTER JOIN `dev_drupal_project`.field_data_field_function f ON u.uid = f.entity_id 
LEFT OUTER JOIN `dev_drupal_project`.field_data_field_phone_intern_ pi ON u.uid = pi.entity_id 
GROUP BY u.uid;
Filters after the GROUP BY is executed can be applied with the HAVING clause, which is equivalent to a WHERE condition, but for the latest stage of the execution. So, assuming the rest of the query is right:

SELECT 
  u.uid AS uid,
  u.name AS name, 
  u.picture AS picture,
  n.field_full_name_value AS field_full_name_value,
  f.field_function_value AS field_function_value,
  pi.field_phone_intern__value AS field_phone_intern__value,
  ur.rid AS rid,
  COUNT(*) AS rolecount
FROM `dev_drupal_wurth-intranet`.users u 
LEFT OUTER JOIN `dev_drupal_project`.users_roles ur 
  ON u.uid = ur.uid 
LEFT OUTER JOIN `dev_drupal_project`.field_data_field_full_name n 
  ON u.uid = n.entity_id 
LEFT OUTER JOIN `dev_drupal_project`.field_data_field_function f 
  ON u.uid = f.entity_id 
LEFT OUTER JOIN `dev_drupal_project`.field_data_field_phone_intern_ pi 
  ON u.uid = pi.entity_id 
GROUP BY u.uid
HAVING rolecount = 1;


You can use the alias (I recommend it) or the count(*) expression for filtering, but those cannot be on a WHERE clause.