Added having restrictions

- Having restrictions are implemented exactly the same as where restrictions,
  except that they will appear in the 'having' part of the query.