Are you sure that your situation table doesn't have some more fields? Fernando 
has three entries in situation so how do you know which one is the "last" one? 
Are you just going to assume that the highest situation.id is the last one  or 
is there a timestamp in there or some sort of "active" flag? If you are going 
to go by highest situation.id you could probably do a sub query to get each 
person's highest situation.id and work from there. Not really sure that's the 
best design though.

Or if you are 100% sure that statuses will always proceed through the system in 
1 -> 2 -> 3 (or 4) order you could just select their max () situation.id_status 
but I doubt that is going to be the case.

If a person can have only one valid situation status at a time but you still 
need a history of past statuses could you use the DAL's record versioning 
feature?

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to