title: MySQL Get One Column Only Once
body: <p>I have 2 MySQL tables in which I get data from in one query</p>
  
  <p>"tables" table:
  <a href="https://i.stack.imgur.com/JGW3a.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/JGW3a.png" alt="enter image description here"></a></p>
  
  <p>"checks" table:
  <a href="https://i.stack.imgur.com/IuryG.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/IuryG.png" alt="enter image description here"></a></p>
  
  <p>The query I have been trying and the result of it:</p>
  
  <pre><code>SELECT tables.tableName, tables.tableRes, tables.tableResFor, checks.chkID, checks.chkDate, checks.chkStatus 
  FROM tables 
  LEFT JOIN checks ON tables.tableID=checks.chkTable 
  WHERE tables.tableID=3 
  ORDER BY checks.chkStatus DESC, checks.chkID ASC
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/vu5MH.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/vu5MH.png" alt="enter image description here"></a></p>
  
  <p>Here are the problems</p>
  
  <ul>
  <li>If there were no results from the query, I need the tableName column which comes out never null, so other columns can be null (works now)</li>
  <li>I don't want to get the rows after first row, if the chkStatus column is 1 or 0 or null, shortly I need the rows with 2 on chkStatus, if the first row is 0, 1 or null, I don't need the other rows...</li>
  </ul>
  
  <p>Thanks in advance, I have been working on this problem for more than 10 hours...</p>