Hi all~
请教一个简单的SQL语句。
可以写成多条(存储过程)"如果某条记录在表中不存在,则插入一条,并选出刚刚插入的那条数据。"+---------------+
| xid (auto inc)|
+---------------+
| 1 |
| 2 |
+----------------(类似下面这条语句,但下面这条语句不能返回结果)insert into tb
select 3 from dual where
not exists( select * from tb where xid = 3 ) ;
请教一个简单的SQL语句。
可以写成多条(存储过程)"如果某条记录在表中不存在,则插入一条,并选出刚刚插入的那条数据。"+---------------+
| xid (auto inc)|
+---------------+
| 1 |
| 2 |
+----------------(类似下面这条语句,但下面这条语句不能返回结果)insert into tb
select 3 from dual where
not exists( select * from tb where xid = 3 ) ;
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货