neither.... let's leave alone event('name') that isn't in the table.
that query returns the event id for each device_id in the events table, and 
attaches to it brand and location from the devices table. additionally, it 
appends the date to it.

the only way to retrieve that set in one query is

select a.id, a.date, b.brand, b.location from events a, devices b
where 
a.device_id = b.id
and a.id in (
select max(id) from events
group by device_id
)




-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" 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/groups/opt_out.


Reply via email to