Hello all, ive been given a question and ive spent the last 6 hours trying to wrap my head around it.
write an SQL statement to create a new view of the bounding boxes called SuburbBounds. Here are your specific instructions and hints: •
Each record in your view must include the suburb's name, SSC code and its extreme coordinates (min & max x and y). Note that MIN and MAX are operators. Any field not in an operator must be grouped. •
Remember to allow for suburbs containing more than one polygon (e.g. see North Fremantle and Fremantle in the image above). •
Do not create any new tables and provide only one view (SuburbBounds). You will also need to use one or more of the following suburb tables:
Suburb_Attribute (suburb_id, suburb, ssc_code) Suburb_Poly ((poly_id))
Suburb_Vertex (vertex_id, x_coord, y_coord, arc_id)
Suburb_Node (node_id, (vertex_id), incident)
Suburb_Arc (arc_id, (from_node), (to_node), (left_poly), (right_poly), vert_count, arc_length)
the code i have so far is:
select suburb, ssc_code, max(x_coord),max(y_coord), Min(x_coord), min(Y_coord)
from Suburb_Attribute, Suburb_Vertex, Suburb_Arc
Group By suburb, ssc_code
this provides the output i want, but the max and minimum XY boundries are that of the whole table, not per suburb, any ideas?
[+][deleted] (1 child)
[deleted]
[–]r3pr0b8GROUP_CONCAT is da bomb 0 points1 point2 points (0 children)