如何在Oracle中插入数据?
我有一个表T1。 根据另一个表T2,T3等的查询结果将数据插入该表中
我想
Insert into table_t1 (column1,column2,column3,column4)
Select col1, col2, Have_to_check_condition_here_and_then_insert_value, Have_to_check_condition_here_and_then_insert_value from table_t2
where condition;
。而且,这也是有条件地,这意味着如果某事是正确的,那么我将把value_something放在否则value_another_thing。表3和第4位与特定列上的第二个表连接。
I've a table t1. And I want to insert data into this table based on query result of another tables t2, t3 etc.
I'm doing it like this-
Insert into table_t1 (column1,column2,column3,column4)
Select col1, col2, Have_to_check_condition_here_and_then_insert_value, Have_to_check_condition_here_and_then_insert_value from table_t2
where condition;
The problem I'm facing is how to put values inside column3 and column4 which comes from table_t3 and table_t4 and that too conditionally, it means if something is true then I'll put value_something otherwise value_another_thing. Table 3rd and 4th are connected with 2nd table on a particular column.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
有了您发布的信息,这将是这样的:
With as much info as you posted, that would be something like this: