s = "delete MAX(id) from emp";
cmd = new SqlCommand(s, con);
cmd.ExecuteNonQuery();
GridView1.DataBind();
错误:'('。
附近的语法不正确
当我尝试在运行时错误显示上面执行此查询.... enter code here
答案 0 :(得分:9)
更正您的查询。
s= "delete from emp where id = (select max(id) from emp)";