create table Mytable1
(ID int,
Fname varchar(50)
)
create table Mytable2
(ID int,
Lname varchar(50)
)
insert into Mytable1 (ID,Fname)
values (1,'you')
insert into Mytable1 (ID,Fname)
values (2,'Tou')
insert into Mytable1 (ID,Fname)
values (3,'Nou')
insert into Mytable2 (ID,Lname)
values (1,'you2')
フィールドFname
はテーブルに存在しませんがMytable2
、次のクエリの結果があります:
select * from Mytable1 where Fname in (select Fname from Mytable2)
注:SQLサーバー2008を使用すると、結果はテーブルMytable1のすべての行になります
それはSQLのバグですか?