主从表查询
主表字段
id inttitle varchar
id intparentid int --主表的IDfilename varchar
select top 25 a.* from ta a join tb b on a.id=b.parentid where b.filename is not null or filename<>''
[解决办法]
select top 25 a.* from tb a,tb b where a.id=b.id and b.filename is not null
[解决办法]
SELECT TOP 25 a.* FROM ta a,tb b WHERE a.id=b.parentid AND( b.filename is not null AND b.filename<>'')
[解决办法]
select top 25 p.id,p.title,s.filename from temp_main as p inner join temp_detail as son p.id=s.parentid where filename is not null or filename<>''