Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/sql/70.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
oracle sql开发人员更新查询_Sql_Oracle - Fatal编程技术网

oracle sql开发人员更新查询

oracle sql开发人员更新查询,sql,oracle,Sql,Oracle,我想在bookhangar表中插入plane_id,其中book列的值为“no”。 我的书库桌子是空的 hangar_id | book | plane_id ------------------------------- han103 | no | null han104 | yes |pla102 我的问题是 insert into bookhangar (plane_id) values('pla104') where book='no';

我想在bookhangar表中插入plane_id,其中book列的值为“no”。 我的书库桌子是空的

hangar_id |  book | plane_id 
-------------------------------         
han103    |   no  | null

han104    |   yes |pla102
我的问题是

insert into bookhangar (plane_id) values('pla104') where book='no';
但它没有插入

我又问了一个问题

update  bookhangar set plane_id='PLA104' where book='no';

它也不工作。

您的更新应该可以工作:

update bookhangar
    set plane_id = 'PLA104'
    where book = 'no';
如果没有,我将首先检查这个查询是否有效

select *
from bookhangar
where book = 'no';
我怀疑这不会返回任何行。那么,试试这个:

select *
from bookhangar
where book like '%no%';

您需要调查实际存储的值。它可能有隐藏字符,例如字符串开头的空格。

如果有任何行包含值“否”,它将被更新

update  bookhangar set plane_id='PLA104' where lower(trim(book))='no';

首先,在insert语句中不能使用where子句,除非在insert…select..where中。对于那个update语句,您收到了什么错误消息?可以在WHERE中插入什么意思?哇…现在可以了…您的查询对我有效…谢谢您,我的表有很多值…并从bookhangar中选择*其中book='no';上面的查询返回值…我得到了解决方案…解决方案是update bookhangar set plane_id='PLA104',其中lowertrimbook='no';