Click here to Skip to main content
15,882,114 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
How to display three columns data from one table as single column ?

SQL
Select ACODE as ID, PARTY_NAME as [NAME] from Tblmst_Party left outer join TblTrn_Purch_Enquiry a on Tblmst_Party.ACODE = a.PARTY_CODE1 left outer join TblTrn_Purch_Enquiry b on b.PARTY_CODE2 = tblmst_Party.ACODE left outer join TblTrn_Purch_Enquiry c on c.PARTY_CODE3 = tblmst_Party.ACODE  where c.ENQNO =16


this is going wrong please suggest me any idea.
Posted
Updated 24-Aug-11 19:53pm
v2
Comments
walterhevedeich 25-Aug-11 1:54am    
You simply concatenate the values, like this.

SELECT val1 + val2 + val3 as tblColumn from yourTable.

Try this..

Select ACODE+PARTY_NAME as [ID and NAME] from Tblmst_Party left outer join TblTrn_Purch_Enquiry a on Tblmst_Party.ACODE = a.PARTY_CODE1 left outer join TblTrn_Purch_Enquiry b on b.PARTY_CODE2 = tblmst_Party.ACODE left outer join TblTrn_Purch_Enquiry c on c.PARTY_CODE3 = tblmst_Party.ACODE  where c.ENQNO =16
 
Share this answer
 
v2
try to find out in the following way.

select Cast(ID as varchar(20))+Cast(ENQNO  as varchar(20))+PARTY_NAME as Name from YourTableName
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900