title: Fetch name based on single query
body: <p>Need help with below query which I am not able to figure out
  I have two tables<br /></p>
  <p><strong>Table 1 - User</strong></p>
  <pre><code>UserId  Name
  ------  ----
  1       Abc
  2       Xyz
  3       Pqr
  4       Ppp
  5       AAA
  </code></pre>
  <p><strong>Table 2 - SubscriptionAssignment</strong></p>
  <pre><code>UserId  PlanName  PurchasedBy
  ------  --------  -----------
  1       Basic     3
  2       Pro       3
  4       Pro       5
  </code></pre>
  <p>(UserId and PurchasedBy has foreign key reference to UserId in User table). I want to get reporting data by joining these two table in below format where lets say</p>
  <p>PurchasedBy=3</p>
  <pre><code>Name  PlanName  PurchasedBy
  ----  --------  -----------
  Abc   Basic     Pqr
  Xyz   Pro       Pqr
  </code></pre>