I like to access variable columns/fields of a row in SQL, how can it be done? For example, in web2py x = db(db.table.name=="john").select().last().job1 will give you the job field of the row where name equal "john". But let's say I want to choose other field/column for x in another condition like
if conditon1:
column = job1
if condition2:
column = job2
x = db(db.table.name=="john").select().last().column
how can I do this?