select a.*,pano=a.pa_no,b.pa_name,f.dp_name,e.fw_state_nm,g.fa_name from LJSS007H a (nolock) Left join LJPA002H b (nolock) On a.pa_no =b.pa_no Left join LJMI007H c (nolock) On c.pa_no =b.pa_no1 Left join LJSS015H g (nolock) On g.fa_no =c.fa_no Left join LJMI008H f (nolock) On f.fa_no=c.fa_no and f.dp_no =c.dp_no left join LJSS008H e (nolock) on a.fw_state=e.fw_state_no where a.fm_no ='AAAA' and a.fw_nu='BBBB' ORDER BY a.uid