<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:arial, helvetica, sans-serif;font-size:10pt;color:#000000;"><div style="color: rgb(0, 0, 0); font-family: arial, helvetica, sans-serif; font-size: 10pt; ">Hi,</div><div style="color: rgb(0, 0, 0); font-family: arial, helvetica, sans-serif; font-size: 10pt; "><br></div><div style="color: rgb(0, 0, 0); font-family: arial, helvetica, sans-serif; font-size: 10pt; ">I have a table called "windturbines". </div><div style="color: rgb(0, 0, 0); font-family: arial, helvetica, sans-serif; font-size: 10pt; ">I have created a view called "v_sum_yield".</div><div style="color: rgb(0, 0, 0); font-family: arial, helvetica, sans-serif; font-size: 10pt; "><br></div><div style="color: rgb(0, 0, 0); font-family: arial, helvetica, sans-serif; font-size: 10pt; ">I would now like to either create another view which consists of both tables joined with the column
 "bez", or join the view to the original table.</div><div style="color: rgb(0, 0, 0); font-family: arial, helvetica, sans-serif; font-size: 10pt; "><br></div><div style="color: rgb(0, 0, 0); font-family: arial, helvetica, sans-serif; font-size: 10pt; ">The table comprises of single wind turbines and their yield per year. I need to sum the yields according to the region. This table then needs to be served as wfs/wms through geoserver.</div><div style="color: rgb(0, 0, 0); font-family: arial, helvetica, sans-serif; font-size: 10pt; "><br></div><div style="color: rgb(0, 0, 0); font-family: arial, helvetica, sans-serif; font-size: 10pt; ">my first step was...</div><div style="color: rgb(0, 0, 0); font-family: arial, helvetica, sans-serif; font-size: 10pt; "><br></div><div style="color: rgb(0, 0, 0); font-family: arial, helvetica, sans-serif; font-size: 10pt; "><div>CREATE VIEW v_sum_yield AS</div><div>select region, sum(yield) AS result </div><div>from
 windturbines</div><div>group by region</div></div><div style="color: rgb(0, 0, 0); font-family: arial, helvetica, sans-serif; font-size: 10pt; "><br></div><div style="color: rgb(0, 0, 0); font-family: arial, helvetica, sans-serif; font-size: 10pt; ">and then to create another view comprising of an left outer join to the original table...</div><div style="color: rgb(0, 0, 0); font-family: arial, helvetica, sans-serif; font-size: 10pt; "><br></div><div><div><font class="Apple-style-span" face="arial, helvetica, sans-serif" size="2"><br></font></div><div><span class="Apple-style-span" style="font-family: arial, helvetica, sans-serif; font-size: 13px; "><div>CREATE VIEW v_join AS</div><div><br></div></span></div><div><font class="Apple-style-span" face="arial, helvetica, sans-serif" size="2"><div>SELECT *</div><div>    FROM windturbines LEFT OUTER JOIN v_sum_yield ON (windturbines.region = v_sum_yield.region);</div><div><br></div><div>the result
 is..</div><div><br></div></font><span class="Apple-style-span" style="font-family: arial, helvetica, sans-serif; font-size: small; ">ERROR: column "region" specified more than once</span><font class="Apple-style-span" face="arial, helvetica, sans-serif" size="2"><div><div>SQL Status:42701</div></div><div><br></div><div>however if I just run the selection with the "CREATE VIEW v_join AS"...it works fine.</div><div><br></div><div>can anyone tell me why?</div><div><br></div><div><br></div><div>thanks,</div><div><br></div><div>Rob</div></font></div></div><div style="color: rgb(0, 0, 0); font-family: arial, helvetica, sans-serif; font-size: 10pt; position: fixed; "></div>


</div></body></html>