Select case_no, Count(*) nTimes; From TableName; Group By case_no; Having Count(*) > 1; Into Cursor cursor_duplicated * Or switch Having for * Having nTimes > 1