fix sql.
fix view.