为什么删除有主键的表的时候,条件不能是非主键字段
代码如下(plsql):
SQL> desc tb27_1
Name Type Nullable Default Comments
----- --------- -------- ------- --------
ID NUMBER(3)
GARDE NUMBER(3) Y
//id是主键
SQL> select * from tb27_1 ;
ID GARDE
---- -----
1 2
3 4
SQL> delete from tb27_1 where garde=2;
delete from tb27_1 where GRADE=2
ORA-00904: "GRADE": 标识符无效
SQL> delete from tb27_1 where id=1;
1 row deleted