title: Remove duplicate from certain columns with sql query
body: <p>The current query:</p>
  <pre><code>$query = sprintf(&quot;
  SELECT compdetails.compname, compdetails.message, specdetails.expirydate, 
  specdetails.specday, specdetails.specname, specdetails.specorig, specdetails.specspec, 
  specdetails.startdate, complocations.address, complocations.lat, complocations.lng 
  
  FROM compdetails, complocations, specdetails 
  WHERE compdetails.compid='%s' 
          
  AND specdetails.compid='%s' 
  AND complocations.compid='%s'&quot;,
          
  </code></pre>
  <p>So:</p>
  <p>Compdetails table: <br>compname <br>message
  <br><br>Specdetails table: <br>expirydate <br>specday <br>specname <br>specorig <br>specspec <br>startdate <br><br>complocations table: <br>address <br>lat <br>lng</p>
  <p>What I'm having issues with:</p>
  <p>Removing the dupes from this view. See image <img src="https://i.stack.imgur.com/FTghz.png" alt="here" /></p>
  <p>I only need the following listed once:
  <br></p>
  <ol>
  <li>compname message<br>2. expirydate, specday, specname, specorig, specspec, stardate once  each for each address<br></li>
  <li>lat,lng per address<br><br></li>
  </ol>