ID FID Lname
2 0 配电房进线(树杆)
21 2 配电房进线(树杆)
211 21 配电房进线(树杆)
212 21 配电房进线(树杆)
213 21 配电房进线(树杆)
214 21 配电房进线(树杆)
216 21 配电房进线(树杆)
22 2 配配电房进线(树杆)
目前我用以下这个语句只能查出FID为2的ID为21的相关记录,我想把FID为2,ID为22的数据也显示出来.
select lineid,linefid,lname from sys_Line where lineid=2 or linefid=2
or linefid=(select top 1 lineid from sys_line where linefid=2 and lineid <> 0)
在线等!急急!
------解决方案--------------------
select lineid,linefid,lname from sys_Line where linefid=2 and lineid in (21,22)