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')
The Fname field Fname not exist in the table Mytable2 But we have the result for the following query:
select * from Mytable1 where Fname in (select Fname from Mytable2)
Note: I am using SQL Server 2008, the result is all the rows of the table Mytable1
Is this a bug in SQL?
source share