create temporary table foo as select mytable.id as id, mytable.person as person from mytable, person where mytable.person=person.id