title: Select particular record from another table based on condition
body: <p>I have two tables; its structure is given below</p>
  
  <p><a href="https://i.stack.imgur.com/r5QR3.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/r5QR3.png" alt="enter image description here"></a></p>
  
  <p><a href="https://i.stack.imgur.com/XuqNZ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/XuqNZ.png" alt="enter image description here"></a></p>
  
  <p>In the first table I am assigning menu rights based on <strong>RoleID</strong>. In some cases I want to override some additional rights to a particular <strong>user (UserID)</strong>. So this second table is using for additional rights for a particular user.
  In this below example; RoleID=2 and MenuID=4 has no Add rights; So i have added 1 rows in second table. While fetching records I need to get that record from second table instead of third row from the first table. How make a query for this purpose? </p>