title: How to solve this query in sql server by using self join(which I think so) and not using subqueries and nested?
body: <p>The employees who have the same branch are colleagues of each other. You need to write a query that can give you the colleagues of EmpId 'x' and the list of the colleagues should not include the user 'x' himself. For eg:- If x = 4 then the result should be EmpId 1 and 5.</p>
  <p><strong>Note:- You have to do it using only one query. No nested queries or subqueries are allowed.</strong>
  <a href="https://i.stack.imgur.com/xArMm.jpg" rel="nofollow noreferrer">this is the table of above problem</a></p>