Home assign only particular column values to a temp table from select query
Reply: 1

assign only particular column values to a temp table from select query

Enigma State
1#
Enigma State Published in 2017-12-07 06:54:42Z

I am having below query that will return 6 columns and i want only assign particular column (converted_skus) results to temporary table and i need to do further processing on that column only ..

I am not sure how can i assign only particular column values to temporary table where as other columns are not needed for further processing

here is my query

 SELEct distinct 
 clpAct.pk_cert,CCM.leg_sku_des,CCM.converted_sku_des,CCM.converted_skus,
 esitrans.pk_cert,esitrans.part_id from Clp_Active clpAct 
 inner join transfertable esitrans
 ON clpact.pk_cert = esitrans.pk_cert 
 INNER JOIN pass_conversion CCM
 ON esitrans.part_id = CCM.part_number
 where clpAct.subscription_key = @subKey

Would any one please help on this query that would be very grateful to me. Many thanks in advance

I am using sql server as DB

Jayasurya Satheesh
2#
Jayasurya Satheesh Reply to 2017-12-07 07:00:51Z

if you don't need the other columns, then just select your required column only and insert it into the temp table. like this

create table #temp
(
converted_skus varchar(50)
)

insert into #temp
(
converted_skus
)
SELEct distinct 
CCM.converted_skus
from Clp_Active clpAct 
 inner join transfertable esitrans
 ON clpact.pk_cert = esitrans.pk_cert 
 INNER JOIN pass_conversion CCM
 ON esitrans.part_id = CCM.part_number
 where clpAct.subscription_key = @subKey

now you have only the required column and values in the temp table #temp

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.343294 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO