title: MySQL - SELECT all columns WHERE one column is DISTINCT
body: <p>I'm very sorry if the question seems too basic.<br/>
  I've surfed entire Internet and StackOverflow for a finished solution, and did not find anything that I can understand, and can't write it myself, so have to ask it here.<br/></p>
  
  <p>I have a MySQL database.<br/>
  It has a table named "posted".<br/>
  It has 8 columns.<br/></p>
  
  <p>I need to output this result:<br/></p>
  
  <pre><code>SELECT DISTINCT link FROM posted WHERE ad='$key' ORDER BY day, month
  </code></pre>
  
  <p>But I need not only the "link" column, but also other columns for this row.<br/>
  Like for every row returned with this query I also need to know its "id" in the table, "day" and "month" values etc.<br/></p>
  
  <p>Please tell me what should I read to make it, or how to make it.<br/>
  Please keep it as simple as possible, as I'm not an expert in MySQL.</p>
  
  <p>Edit:
  I tried this:</p>
  
  <pre><code>SELECT DISTINCT link,id,day,month FROM posted WHERE ad='$key' ORDER BY day, month
  </code></pre>
  
  <p>It doesn't work. It returns too many rows. Say there are 10 rows with same links, but different day/month/id. This script will return all 10, and I want only the first one (for this link).</p>