title: Take recommendation from 3 different tables
body: <p>I have 3 different recommendation model that gives me the output in three different tables.</p>
  <p><strong>Recommendation 1 :</strong> In a ideal situation, I want to take top 2 recommendation per user from this table ordered by ProductRecommendation ascending.</p>
  <p><a href="https://i.stack.imgur.com/xU3KY.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/xU3KY.png" alt="enter image description here" /></a></p>
  <p><strong>Recommendation 2 :</strong> In a ideal situation, I want to take top 3 recommendation per user from this table based on top score.</p>
  <p><a href="https://i.stack.imgur.com/01yJT.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/01yJT.png" alt="enter image description here" /></a></p>
  <p><strong>Recommendation 3 :</strong> In a ideal situation, take remaining recommendation from this table to add up to 5 recommendation per user</p>
  <p><a href="https://i.stack.imgur.com/KZxCB.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/KZxCB.png" alt="enter image description here" /></a></p>
  <p>In the end, I want to see a final output which is a merge of all the recommendation into one which would look like this.</p>
  <p><a href="https://i.stack.imgur.com/k6WwL.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/k6WwL.png" alt="enter image description here" /></a></p>
  <p>I want to take top 5 recommendation across 3 different tables. FYI, not all the user id can appear in all the tables. Ideally, I want to take TOP 2 from recommendation 1, TOP 3 from recommendation 2. Recommendation 3 is just there so that if there are not enough recommendation from the first two table then recommendation 3 will compensate so at the end I will get 5 results per userID. I don't need to refer to recommendation 3 if I can get 5 recommendation (2 from recommendation 1 and 3 from recommendation 2). when the recommendation 1 has &lt; 2 recommendations per user then I want to get the remaining of the recommendation from recommendation 2. For example, when there is 1 recommendation in Recommendtiaon1 then get 4 recommendation from Recommendation2. Alternatively, if there are 0 recommendation in Recommendation1 then get 5 recommendation from Recommendation2. If Recommednation1 and Recommendation2 doesn't add up to 5 that's when I need to refer to recommendation3. I need to do this in big query SQL. Can you please help?</p>
  <p>Thanks for your help.</p>