fixing sql
fixing sql
multitable snag with return type