Hello! db().select(db.tt_on_day.TIMETABLE_ID,distinct=db.tt_on_day.TIMETABLE_ID) >>>SELECT DISTINCT ON (tt_on_day.TIMETABLE_ID) tt_on_day.TIMETABLE_ID FROM tt_on_day
with True - work db().select(db.tt_on_day.TIMETABLE_ID,distinct=True) >>>SELECT DISTINCT tt_on_day.TIMETABLE_ID FROM tt_on_day And I don't understand one more thing. If I do query like that: rows = db((db.t_fac.FULL_NAME != 'НЕИДЕНТИФИЦИРОВАННОЕ') & (db.a_groups.FO == 1) & (db.a_groups.INACTIVE == 0)).select(db.t_fac.id,db.t_fac. FULL_NAME,distinct=True, join=[db.a_groups.on(db. tt_main.GROUP_ID == db.a_groups.id), db.t_fac.on(db. a_groups.FAC == db.t_fac.id)]) Then I want to get id and FULL_NAME in circle: faculties = {} for row in rows: faculties[row.t_fac.id] = row.t_fac.FULL_NAME but I have error, becouse row is dict now and I should write: for row in rows: faculties[row['id']] = row['FULL_NAME'] Why row type is dict? -- 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. To view this discussion on the web visit https://groups.google.com/d/msgid/web2py/29fbd8a1-93df-4467-a0cf-87e099edf919%40googlegroups.com.