Hi Bob,<br><br>Select b.official_name, the_geom,z(the_geom)-top_depth as top, z(the_geom)-bottom_depth, layer_number, lith_type from borehole b left join lithology l using (official_name) order by official_name, layer_number desc;<br>
<br>Is something like this what you are looking for?<br><br>David<br><br><div class="gmail_quote">On Fri, Jun 6, 2008 at 2:09 PM, Bob and Deb <<a href="mailto:bobdebm@gmail.com">bobdebm@gmail.com</a>> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hello all,<br><br>I'm new to postgis and postgresql and I need some help with a query.  I am trying to visualize some boreholes by connecting <br>the 3d point geometry from a borehole spatial table to the different rock formations (non spatial table called lithology).  borehole <br>

has a key field called official_name and 3d point geometry called the_geom.  lithology has a key field official_name,layer_number <br>as well as top_depth, bottom_depth, and lith_type.<br><br>     x      <----- borehole location                <---- top_depth  of 1st lith<br>

     |<br>     |<br>     x                                                      <--- bottom_depth of 1st lith          <--- top_depth of 2nd lith<br>     |<br>     |<br>     x                                                                                                        <--- bottom_depth of 2nd lith<br>

<br>I have figured out how to use ST_MakeLine to make a line that connection for a borehole down to its total depth ( max(bottom_depth) ), <br>but I have not figured out a query that would do what I diagrammed above.<br>
<br>
I'm using this database to learn both postgis and postgresql and would greatly appreciate any help.<br><br>Thank in advance.<br><br>Bob<br><br>select official_name, the_geom from borehole<br>select official_name, top_depth, bottom_depth, layer_number, lith_type from lithology<br>

<br>_______________________________________________<br>
postgis-users mailing list<br>
<a href="mailto:postgis-users@postgis.refractions.net">postgis-users@postgis.refractions.net</a><br>
<a href="http://postgis.refractions.net/mailman/listinfo/postgis-users" target="_blank">http://postgis.refractions.net/mailman/listinfo/postgis-users</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br>************************************<br>David William Bitner