<div dir="ltr"><div><div><div><a href="http://www.postgresql.org/docs/9.3/static/plpgsql.html">http://www.postgresql.org/docs/9.3/static/plpgsql.html</a><br><br></div>I'm not sure you need plpgsql for this, looks like you could do in sql only <br>
</div>(maybe even no need of CASE WHEN)<br><br></div>Cheers,<br>Rémi-C<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">2014-03-05 17:38 GMT+01:00 mane moshref <span dir="ltr"><<a href="mailto:many_yammy@yahoo.com" target="_blank">many_yammy@yahoo.com</a>></span>:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div style="font-size:10pt;font-family:HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif"><div>
Hi all,</div><div> </div><div>I am quite new to pl/pgsql and completely confused. </div><div>I have two tables. One storing height category including hk_id(height category id), h_min and h_max. and a table including several plygons having y_max and height. My aim is to know on which height category the plygon locates based on its y_max.</div>
<div>My piece of code is like:</div><div> </div><div>i=1; a=0;</div><div>while (i=<4 , a=0){</div><div>        if h(i)_min < y_max < h(i)_max</div><div>             {height = i</div><div>             a = 1;}</div>
<div>        i = i + 1</div><div>        }</div><div> </div><div>Is there any body who can help me to convert this piece of code to excutable format in pl/pgsql?</div><div> </div><div>Thank you in
 advance</div><div>Many</div><div> </div><div><br clear="all"></div></div></div><br>_______________________________________________<br>
postgis-users mailing list<br>
<a href="mailto:postgis-users@lists.osgeo.org">postgis-users@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users" target="_blank">http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users</a><br></blockquote></div><br></div>