[英]WHERE Clause in ORACLE
How to use WHERE clause while inserting values into the table? 在表中插入值时如何使用WHERE子句?
I tried the below query to insert values into the column, whichever set address='COB' 我尝试了以下查询以将值插入列,无论哪个设置了地址='COB'
insert into table empt (loc,country,mob)
values ('&loc','&country',&mob)
where address='COB';
This looks like you may need to use update
if the field already exists in your table - 如果您的表格中已经存在该字段,则看起来您可能需要使用update
ie 即
update empt
set loc =?, country = ?, mob=?
where address ='COB';
I don't know, why you are using "Table" in insert statement. 我不知道,为什么要在插入语句中使用“表”。
INSERT 插入
insert into empt (loc,country,mob)
values ('&loc','&country',&mob)
Hope you need Update. 希望您需要更新。
UPDATE 更新
Update empt
Set loc = '&loc',
country = '&country',
mob = &mob
where address='COB';
Please refer SQL Statements used in oracle 请参考oracle中使用的SQL语句
https://docs.oracle.com/database/121/TDDDG/tdddg_dml.htm#TDDDG23100 https://docs.oracle.com/database/121/TDDDG/tdddg_dml.htm#TDDDG23100
insert into table empt (loc,country,mob)
select loc,country,&mob
where address='COB';
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.