早教吧作业答案频道 -->其他-->
select1frombwhereb.id=a.id和select1fromawhereb.id=a.id有区别么?请问他们有区别么?举个例子:select*frombwhereexists(select1fromawherea.c=b.c)select*frombwhereexists(select1frombwherea.c=
题目详情
select 1 from b where b.id = a.id和 select 1 from a where b.id = a.id有区别么?
请问他们有区别么?
举个例子:
select * from b where exists (select 1 from a where a.c=b.c)
select * from b where exists (select 1 from b where a.c=b.c)
这两句有区别么?
请问他们有区别么?
举个例子:
select * from b where exists (select 1 from a where a.c=b.c)
select * from b where exists (select 1 from b where a.c=b.c)
这两句有区别么?
▼优质解答
答案和解析
选的表不同,你的例子,第一个是从b表选a.c=b.c的数据,第二个是从a表选。就好像a有3个c=1,b有1个c=1,你说从不同表选c=1结果一样不?就这意思。
其实你的:select * from b where exists (select 1 from a where a.c=b.c)
等价于:select * from b where b.c IN (select a.c from a where a.c=b.c)
可能用下面这句容易看懂些。就是从b表中查找与a表有相同字段c的所有结果集。
其实你的:select * from b where exists (select 1 from a where a.c=b.c)
等价于:select * from b where b.c IN (select a.c from a where a.c=b.c)
可能用下面这句容易看懂些。就是从b表中查找与a表有相同字段c的所有结果集。
看了 select1frombwh...的网友还看了以下:
A、B、C、D、E、F六种元素,其中ABCDE为短周期元素,①原子半径A<C<B<E<D②原子最外 2020-05-13 …
设一数列a,b,c,d,e,f,通过栈结构不可能不可能排成的顺序数列为()A)c,b,e,f,d, 2020-06-28 …
一个9位数abcdefghi满足:1.a+b+...+h+i=cd2.a(b+d-c)=243.( 2020-07-19 …
Tony:Goodmorning,Gina.Gina:小题1:Tony:小题2:Gina:I’mOk 2020-10-30 …
Tony:GoodmorningGina.Gina:1.Tony2.Gina:I’mOkThanky 2020-10-30 …
Tony:Goodmorning,Gina.Gina:小题1:Tony小题2:Gina:I’mOk, 2020-10-30 …
f(z)=(e^x)(xcosy-ysiny)+x-y+c+i[(e^x)(ycosy+xsiny) 2020-10-30 …
一个9位数abcdefghi满足:1.a+b+...+h+i=cd2.a(b+d-c)=243.(e 2020-11-19 …
求解多元一次不等式的编程47a-b-c-d-e-f-g>047b-a-c-d-e-f-g>023c- 2020-12-14 …
用所给字母组成单词并写中文意思s,e,c,i,e,n,c()d,t,a,o,y()按要求写英语lon 2021-01-30 …