Row to Col

0

Please login or register to vote for this query.

(click on this box to dismiss)

Amateur Radio

Q&A for amateur radio enthusiasts

CREATE table #table1
    (Campaign_ID varchar(50), SMS_TEXT_VAR_1 varchar(50),SMS_DATA_VAR_2 varchar(50))
;
    
INSERT INTO #table1
    (Campaign_ID,SMS_TEXT_VAR_1,SMS_DATA_VAR_2)
VALUES
('C0701002','Right now, you can...','handset_1_storage')
;

CREATE table #table2
    (Campaign_ID varchar(50), handset_1_storage varchar(50))
;
    
INSERT INTO #table2
    (Campaign_ID,handset_1_storage)
VALUES
('C0701002','64')
;


select 
Campaign_ID
, max(case when SMS_DATA_VAR_2 = 'handset_1_storage' then 'Yes' else 'No' end) as handset_1_storage
from #table1
group by Campaign_ID

Enter Parameters

Options:
Switch sites:
loading Hold tight while we fetch your results