SELECT DriverID, DriverName, list(CarCost) FROM ( ... ) GROUP BY DriverID, DriverName
Il giorno gio 7 mar 2019 alle ore 12:27 Luigi Dell'Aquila < [email protected]> ha scritto: > oh, sorry, I didn't scroll the screen :D > > You have to use a set() or list() aggregation on CarCost and do a GROUP BY > on the other columns > > Thanks > > Luigi > > Il giorno gio 7 mar 2019 alle ore 12:26 Luigi Dell'Aquila < > [email protected]> ha scritto: > >> Hi Michael, >> >> Just add a DISTINCT to the RETURN, ie >> >> RETURN DISTINCT driver.@rid AS DriverID, driver.name AS DriverName, >> car.cost AS CarCost >> >> Thanks >> >> Luigi >> >> Il giorno mer 6 mar 2019 alle ore 22:46 Michael Faughn < >> [email protected]> ha scritto: >> >>> SELECT * FROM (MATCH {Class: Person, as: driver, where:(name='Bob')}- >>> Driving->{Class: Vehicle, as:car} RETURN driver.@rid AS DriverID, driver >>> .name AS DriverName, car.cost AS CarCost) >>> >>> results in the following: >>> >>> DriverID >>> DriverName >>> CarCost >>> #332:0 >>> <http://localhost:2480/studio/index.html#/database/test/browse/edit/332:0> >>> Bob >>> 222 >>> #332:0 >>> <http://localhost:2480/studio/index.html#/database/test/browse/edit/332:0> >>> Bob >>> 111 >>> >>> I would instead like the following: >>> >>> DriverID >>> DriverName >>> CarCost >>> #332:0 >>> <http://localhost:2480/studio/index.html#/database/test/browse/edit/332:0> >>> Bob >>> [222, 111] >>> >>> Is there a way to write the query so that this can happen? >>> >>> -- >>> >>> --- >>> You received this message because you are subscribed to the Google >>> Groups "OrientDB" group. >>> To unsubscribe from this group and stop receiving emails from it, send >>> an email to [email protected]. >>> For more options, visit https://groups.google.com/d/optout. >>> >> -- --- You received this message because you are subscribed to the Google Groups "OrientDB" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
