<div dir="ltr"><div dir="ltr"><div dir="ltr">In this example, <a href="http://blog.cleverelephant.ca/2010/07/network-walking-in-postgis.html">Network Walking in PostGIS · Paul Ramsey (cleverelephant.ca)</a></div><div dir="ltr"><br></div><div>3 rows got returns as follows:</div><div><br></div><div><pre class="gmail-highlight" style="box-sizing:border-box;font-family:Menlo,Monaco,"Courier New",monospace;margin-top:0px;margin-bottom:0px;padding:1rem;font-size:0.8rem;line-height:1.4;white-space:pre-wrap;word-break:break-all;background-color:rgb(249,249,249);border-radius:4px;color:rgb(81,81,81)"><code style="box-sizing:border-box;font-family:Menlo,Monaco,"Courier New",monospace;padding:0px;font-size:16px;color:inherit;background-color:transparent;border-radius:3px"> id
---
  6
  3
  1</code></pre><pre class="gmail-highlight" style="box-sizing:border-box;font-family:Menlo,Monaco,"Courier New",monospace;margin-top:0px;margin-bottom:0px;padding:1rem;font-size:0.8rem;line-height:1.4;white-space:pre-wrap;word-break:break-all;background-color:rgb(249,249,249);border-radius:4px;color:rgb(81,81,81)"><code style="box-sizing:border-box;font-family:Menlo,Monaco,"Courier New",monospace;padding:0px;font-size:16px;color:inherit;background-color:transparent;border-radius:3px"><br></code></pre><pre class="gmail-highlight" style="box-sizing:border-box;font-family:Menlo,Monaco,"Courier New",monospace;margin-top:0px;margin-bottom:0px;padding:1rem;font-size:0.8rem;line-height:1.4;white-space:pre-wrap;word-break:break-all;background-color:rgb(249,249,249);border-radius:4px;color:rgb(81,81,81)"><code style="box-sizing:border-box;font-family:Menlo,Monaco,"Courier New",monospace;padding:0px;font-size:16px;color:inherit;background-color:transparent;border-radius:3px">How to just get the last (namely, 1) in the most efficient way?</code></pre><pre class="gmail-highlight" style="box-sizing:border-box;font-family:Menlo,Monaco,"Courier New",monospace;margin-top:0px;margin-bottom:0px;padding:1rem;font-size:0.8rem;line-height:1.4;white-space:pre-wrap;word-break:break-all;background-color:rgb(249,249,249);border-radius:4px;color:rgb(81,81,81)">Regards, David</pre></div></div></div>