1 Reply Latest reply: Mar 31, 2011 6:18 PM by alwu-Oracle RSS

    about group by & order by

    848682
      SELECT ?move ?road ?submoveslice WHERE {
      ?move <rdf:type> <u:move>.
      ?submoveslice <rdf:type> <u:submove_slice>.
      ?road <rdf:type> <u:road>.
      ?move <u:has_submove> ?submove.
      ?submoveslice <u:submove_at> ?submove.
      ?submove ?relate ?road.
      }

      Hi,using the above sparql statement,i get the following result,
      now i want to grouping them using "move" and ordering using "submoveslice",then get the result : <u:move11> -<u:road1><u:road1><u:road2><u:road3> and <u:move22>-<u:road2><u:road3><u:road1><u:road3>,how to?

      | move | road | submoveslice |
      ================================================
      | <u:move22> | <u:road3> | <u:submove_slice22> |
      | <u:move11> | <u:road3> | <u:submove_slice14> |
      | <u:move22> | <u:road2> | <u:submove_slice21> |
      | <u:move11> | <u:road1> | <u:submove_slice11> |
      | <u:move22> | <u:road1> | <u:submove_slice23> |
      | <u:move11> | <u:road2> | <u:submove_slice13> |
      | <u:move11> | <u:road1> | <u:submove_slice12> |
      | <u:move22> | <u:road3> | <u:submove_slice24> |
      ------------------------------------------------

      Thank you!!!