SQLs for document list view fixed.