子查询的疑惑
imfjl 2004-04-06 04:30:21 我需要对一个表table1的每条记录都去判断它的域field1是否满足某个条件.这种条件在table2中定义.所以,我想通过子查询实现.语句如下:
select * from table1 where exists (select 'a' from table2 where table1.field1 between table2.field4 and table2.field5);
但发现select出来的和
select * from table1 where table.field1 between 1 and 100;不一样.(table2里只有一条记录,其中field4=1,field5=100).
为什么啊?