SELECT M.[id],[ContractNo],[seller],[buyer],[STT],M.[countryid],[creator] ,[Auditor],[MainState],[printed],[AutoAPP],[ShipCompany_id],[BillNo] ,[BillType],[Vessel],[Voyage],[Ex_sailingdate],[ArrivalDate] ,[ContainerNo],[SealNo],[TransactionMethod],[PaymentMethods] ,[SecurityDeposit],[CustomsReleaseDate],[SamplingDate_Plan] ,[SamplingDate_Act],[inspection_Signup_date] ,[inspection_no],[inspection_date] ,cg.id as cgid ,cg.name,c.countryid,c.country FROM [ShippingWeb].[dbo].[Import_main] M left join code_country c on m.countryid=c.countryid left join import_cargo cg on cg.contract_id=M.id left join import_cargoinfo ci on ci.id=cg.cargoinfo_id select * from [user]