title: How to write complex query with mysql join with tables
body: <p>I have tables</p>
  
  <p><code>Tasks- id,name</code></p>
  
  <p>then i have</p>
  
  <p><code>userTasks id , task_id , user_id</code></p>
  
  <p>and</p>
  
  <p><code>User - id , name</code></p>
  
  <p>Suppose i have 10 tasks in task table and out of those i have 3 tasks in <code>userTask</code> table </p>
  
  <p>I want query like this</p>
  
  <p><code>Select task.id , task.name , STATUS (if(presentInUserTasks),1,0) FROM  whatever</code></p>
  
  <p>the STATUS word should <code>1</code> if that task id is present in usertasks table for that userid otherwise it should be <code>0</code></p>
  
  <p>So that i am able to find which of those tasks are alreadu in userTask table</p>