sql help

第N个马甲

新手上路
VIP
注册
2010-05-13
消息
3,121
荣誉分数
56
声望点数
0
Insert into table a of column 1 and column 2 if the combination of column 1 + column 2 doesnot exist in column 1 + column 2 in table b

Any expert in cfc can help with the syntax ? Thank you so much
It is t_sql
 
Insert into table a of column 1 and column 2 if the combination of column 1 + column 2 doesnot exist in column 1 + column 2 in table b

Any expert in cfc can help with the syntax ? Thank you so much
It is t_sql

combination of column 1 + column 2 什么意思?

doesnot exist in column 1 + column 2 什么意思?

那个数据库的 SQL?
 
insert into tableA (column1Name, column2Name) SELECT <column 1>, <column2> where not exists (select 1 from table b where (column1Name = <column 1> and column2Name = <column2>))
 
insert into tableA (column1Name, column2Name) SELECT <column 1>, <column2> where not exists (select 1 from table b where (column1Name = <column 1> and column2Name = <column2>))

Untitled-1.jpg
 
insert into tableA (column1Name, column2Name) SELECT <column 1>, <column2> where not exists (select 1 from table b where (column1Name = <column 1> and column2Name = <column2>))
少个 from ;)
 
insert into tableA (column1Name, column2Name) SELECT <column 1>, <column2> where not exists (select 1 from table b where (column1Name = <column 1> and column2Name = <column2>))

我还没看懂她的题目 :blowzy:

想从你的答案中看看你是怎么理解的。但从你的 SQL 中,<column 1>, <column2> 从哪个表来的?
 
我还没看懂她的题目 :blowzy:

想从你的答案中看看你是怎么理解的。但从你的 SQL 中,<column 1>, <column2> 从哪个表来的?
不从表来,我写反了,应该是EXISTS而不是NO EXISTS
 
我就进来看看码工们是怎么交谈滴。
 
if the combination of column 1 + column 2 doesnot exist in column 1 + column 2 in table b
题目不清。比如说,都是在一个表里吗?如果真的想征答案,解释几条应该被选和不被选的例子。
 
Sorry, insert into table a from table b, if column1+2 in table b, don't exist in table a
 
Thanks Hot dog I searched the web and found something similar
 
简单点,TA和TB里有2个字段,一个是真名,一个是网名
有些人有很多马甲,就会一个真名跟着一堆网名,
如果TA里没有某个真名和网名的组合,就加一条,

你看,我说的多简洁明了。
 
后退
顶部