add two sqls for view.