Click here to Skip to main content
14,691,771 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
My query as follows
select a.years,
 b.season,b.cooperative,
 c.itemcode,
 d.groupname,e.location,a.status from [transact].[transaction_item] a,tbl_farmerregistration_ivorycoast b,[master].[transaction_item_type] c,[master].[transaction_item_group] d,[master].[transaction_location_item_type] e
 where a.transactee_id = b.farmersapcode 
 and a.item_type_id = c.item_type_id
 and a.item_group_id = d.item_group_id
 and e.transaction_item_id = c.transaction_item_type_id 
 and a.status = 'new' and b.isactive = '1'
when I run the above query shows output as follows
Years season      cooperative     itemcode  groupname status
 
  2019  2018   1148339 - Ferke        2       Val       New
I want to display cooperative with two column name

I want the output as follows
Years season      cooperative     id      Name         itemcode  groupname status
 
  2019  2018    1148339 - Ferke    1148339  Ferke        2       Val        New


What I have tried:

From the above query what changes I have to made to get the ouput.
Posted
Updated 22-Jun-18 5:07am
v2
Comments
ZurdoDev 22-Jun-18 12:06pm
   
Use SUBSTR and CHARINDEX. Not too hard at all.

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