SELECT fr.`Location` AS FromLocation,fr.`StoreLocationAddress` FromLocationAddress,fr1.`Location` AS ToLocation, fr1.`StoreLocationAddress` ToLocationAddress, sm.GSTIN FromGSTNNo,sm1.GSTIN ToGSTNNo FROM st_indent_detail id INNER JOIN st_locationmaster fr ON fr.`locationid`=id.`tolocationid` INNER JOIN f_panel_master fpm ON fpm.`Panel_ID`=fr.`Panel_ID` INNER JOIN centre_master cm on cm.`CentreID`=CASE WHEN fpm.`PanelType` ='Centre' then fpm.`CentreID` else fpm.tagprocessinglabid END AND fpm.`PanelType` in('Centre','PUP') and fpm.IsActive=1 INNER JOIN state_master sm ON sm.`id`=cm.`StateID` INNER JOIN st_locationmaster fr1 ON fr1.`locationid`=id.`Fromlocationid` INNER JOIN f_panel_master fpm1 ON fpm1.`Panel_ID`=fr1.`Panel_ID` INNER JOIN centre_master cm1 on cm1.`CentreID`=CASE WHEN fpm1.`PanelType` ='Centre' then fpm1.`CentreID` else fpm1.tagprocessinglabid END AND fpm1.`PanelType` in('Centre','PUP') and fpm1.IsActive=1 INNER JOIN state_master sm1 ON sm1.`id`=cm1.`StateID` WHERE indentno='SI-25020156' and id.IsActive=1 group by indentno