DECLARE E1cursor cursor /* 声明游标,默认为FORWARD_ONLY游标 */
FOR SELECT * FROM c_example
OPEN E1cursor /* 打开游标 */
FETCH NEXT from E1cursor /* 读取第1行数据*/
WHILE @@FETCH_STATUS = 0 /* 用WHILE循环控制游标活动 */
BEGIN
FETCH NEXT from E1cursor /* 在循环体内将读取其余行数据 */
END
CLOSE E1cursor /* 关闭游标 */
DEALLOCATE E1cursor /* 删除游标 */
select zydm,zymc from CM_T_JHK_temp where zydm not in (select zydm from CM_professional )
select * from CM_professional where zydm='101'
delete CM_professional
declare newzy_cursor cursor
for select zydm from cm_t_jhk_temp