gpt4 book ai didi

iphone - 在sqlite中使用行id比较两个表

转载 作者:行者123 更新时间:2023-11-28 22:48:21 25 4
gpt4 key购买 nike

我想从行 ID 等于第一个表的第二个表中获取数据?有人可以用语法或代码帮助我吗?

最佳答案

有很多不同的方法可以做到这一点。

您可以使用加入:

Select t2.* 
from tab2 t2
join tab1 t1 on t1.id = t2.id

你也可以使用in运算符

Select * 
from tab2 t2
where t2.id in ( select t1.id
from table1 t1
)

或者你可以使用exists操作符

Select * 
from tab2 t2
where exists
(
selec 1
from table1 t1
where t2.id = t1.id
)

关于iphone - 在sqlite中使用行id比较两个表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12599074/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com