<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";
mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
{mso-style-priority:99;
mso-style-link:"Ballongtext Char";
margin:0cm;
margin-bottom:.0001pt;
font-size:8.0pt;
font-family:"Tahoma","sans-serif";
mso-fareast-language:EN-US;}
span.E-postmall17
{mso-style-type:personal;
font-family:"Calibri","sans-serif";
color:windowtext;}
span.BallongtextChar
{mso-style-name:"Ballongtext Char";
mso-style-priority:99;
mso-style-link:Ballongtext;
font-family:"Tahoma","sans-serif";}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri","sans-serif";
mso-fareast-language:EN-US;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="SV" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span lang="EN-US">Hi,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">I have 2 tables:<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">obstacles (point layer) with a column height_m (INTEGER) and a
<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">polyobstacles (polygon layer)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">the point layer has obstacles all over the map and the polygon layer has some polygons containing some of the obstacle points.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Now I would like to select the highest obstacle in each polygon. If there is several points with the same highest height a random obstacle of those highest shall be selected.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Is there someone that can get me on the track for such a query, I’m losing myself in subqueries?<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Kind regards,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Paul<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:9.0pt;mso-fareast-language:SV"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:9.0pt;mso-fareast-language:SV">
</span><span style="font-size:9.0pt;mso-fareast-language:SV"><img width="132" height="107" id="Bild_x0020_1" src="cid:image001.jpg@01D5F5FC.17379520" alt="2_LFV_engelsk_96"><o:p></o:p></span></p>
<table class="MsoNormalTable" border="0" cellspacing="0" cellpadding="0" style="border-collapse:collapse">
<tbody>
<tr style="height:36.85pt">
<td width="420" valign="top" style="width:315.0pt;padding:0cm 0cm 0cm 2.25pt;height:36.85pt">
<p class="MsoNormal" style="margin-top:2.0pt;line-height:10.0pt;mso-line-height-rule:exactly">
<span lang="EN-US" style="font-size:9.0pt;color:#333333;mso-fareast-language:SV"><o:p> </o:p></span></p>
<p class="MsoNormal" style="margin-top:2.0pt;line-height:10.0pt;mso-line-height-rule:exactly">
<b><span lang="EN-US" style="font-size:9.0pt;color:#333333;mso-fareast-language:SV"> Paul Malm</span></b><span lang="EN-US" style="font-size:9.0pt;color:#333333;mso-fareast-language:SV"><br>
<br>
Operations AIM</span><span lang="EN-US" style="font-size:9.0pt;color:#333333"><o:p></o:p></span></p>
</td>
</tr>
<tr style="height:24.1pt">
<td width="420" valign="top" style="width:315.0pt;padding:0cm 0cm 0cm 2.25pt;height:24.1pt">
<p class="MsoNormal" style="line-height:9.0pt;mso-line-height-rule:exactly"><span lang="EN-US" style="font-size:9.0pt;color:#333333;mso-fareast-language:SV"> Direct +46 (0)8 797 70 23 Mobile: +46 (0)708 601115<br>
paul.malm@lfv.se <br>
<br>
<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:9.0pt;mso-line-height-rule:exactly"><span lang="EN-US" style="font-size:9.0pt;color:#333333;mso-fareast-language:SV"> </span><span style="font-size:9.0pt;color:#333333;mso-fareast-language:SV">Mail & Visit: Löjtnantsgatan
25, 115 50 Stockholm, Sweden</span><span style="font-size:9.0pt;color:#333333"><o:p></o:p></span></p>
</td>
</tr>
<tr>
<td width="420" valign="top" style="width:315.0pt;padding:0cm 0cm 0cm 2.25pt">
<p class="MsoNormal" style="margin-top:2.0pt;line-height:9.0pt;mso-line-height-rule:exactly">
<span lang="EN-US" style="font-size:9.0pt;color:#333333;mso-fareast-language:SV"> Unit phone: +46 (0)8 797 70 20
<br>
</span><span style="font-size:9.0pt;color:#333333;mso-fareast-language:SV"><a href="http://www.lfv.se/"><span lang="EN-US">www.lfv.se</span></a></span><span lang="EN-US" style="font-size:9.0pt;color:#333333"><o:p></o:p></span></p>
</td>
</tr>
<tr style="height:3.7pt">
<td width="420" valign="top" style="width:315.0pt;padding:0cm 0cm 0cm 2.25pt;height:3.7pt">
<p class="MsoNormal" style="margin-top:6.0pt;line-height:9.0pt;mso-line-height-rule:exactly">
<span lang="EN-US" style="font-size:9.0pt;color:#00CC00;mso-fareast-language:SV"> Please consider the enviroment before printing this e-mail message.</span><span lang="EN-US" style="font-size:9.0pt;color:#00CC00"><o:p></o:p></span></p>
</td>
</tr>
</tbody>
</table>
<p class="MsoNormal"><span lang="EN-US" style="font-size:9.0pt;mso-fareast-language:SV"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
</div>
</body>
</html>