Query as follows
SELECT A._id,B.firstname + '' '' + B.lastname + '' '' + B.surname
as name,A.details
FROM dbo.tbl_farmer_farmdetails_' + @originname + ' A
INNER JOIN dbo.tbl_farmerregistration_' + @originname + ' B ON B.farmerctscode = A.farmer_id
WHERE B.farmerseason = '2018'
When i run the above code i get output as follows
id Name Details
1 Test1 "Product1":"Cilo","Product2":"Zilo"
i want the output as follows
id Name Product1 Product2
1 Test1 Cilo Zilo
from my above sql query what changes i have to made to get the above output
SELECT A._id,B.firstname + '' '' + B.lastname + '' '' + B.surname
as name,A.details
FROM dbo.tbl_farmer_farmdetails_' + @originname + ' A
INNER JOIN dbo.tbl_farmerregistration_' + @originname + ' B ON B.farmerctscode = A.farmer_id
WHERE B.farmerseason = '2018'
When i run the above code i get output as follows
id Name Details
1 Test1 "Product1":"Cilo","Product2":"Zilo"
i want the output as follows
id Name Product1 Product2
1 Test1 Cilo Zilo
from my above sql query what changes i have to made to get the above output

Sankara Krishnan VenugopalRank #833 · 2.7K reputationPosted May 20, 2018, 8:24 AM EDT
Posted May 20, 2018, 7:57 PM EDT
Sankara Krishnan VenugopalRank #833 · 2.7K reputationPosted May 20, 2018, 10:30 PM EDT