我想实现以下功能:表M 有三项ABC,表N有一项C然后有个函数传入三个参数ABC 将ABC插入表M而且C要在N里面查询一下是否存在,不存在就不插入
answer:
其实 很简单的 insert into M values (a,b,c) where exists (select * from N where c = c)
Powered by: 博客园 Copyright © 2024 Trible.H Powered by .NET 8.0 on Kubernetes