title: Query the last few rows in Spreadsheet or SQL
body: <p><em>A1</em> contains the unique transposed data of Sheet1's <em>A</em> </p>
  
  <pre><code>=TRANSPOSE(UNIQUE(QUERY(Sheet1!$A:$A;"select A";1)))
  </code></pre>
  
  <p><em>A2</em> contains the following code:</p>
  
  <pre><code>=QUERY(Sheet1!$A:$B;"select B where A like '%"&amp;A1&amp;"%'";0)
  </code></pre>
  
  <p><em>Sheet1</em> has col <em>A</em> with label <em>name</em> and col <em>B</em> with label <em>height</em></p>
  
  <p>there are different amount of data for names, this is why i want to list only the newest data.
  so:
  <strong>how can i reduce the <em>A2</em>'s query to show only the last 3 content without sorting data?</strong> (updated question)</p>
  
  <p>UPDATE:
  the following strategy can be a solution, bu hope there is more clean way to do:
  always add new data above the <em>Sheet1</em>'s content then adding <code>limit 3</code> to the query.</p>
  
  <p>here is the sandbox: <a href="https://docs.google.com/spreadsheet/ccc?key=0As_Zg0RxlMgXdFR2M3RpT05MX01tSlRKR0RrTXlFb0E&amp;usp=sharing" rel="nofollow">https://docs.google.com/spreadsheet/ccc?key=0As_Zg0RxlMgXdFR2M3RpT05MX01tSlRKR0RrTXlFb0E&amp;usp=sharing</a></p>