Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
tamancha.1
Starting Member
37 Posts |
Posted - 2010-09-28 : 13:18:04
|
var1 var2 new variabletov2009 lead01 Free Trial Buttonstov2009 pgview Page Viewsoab2009 pgview1 Page Viewstov2009 visits All Unique Visitsoab2009 visits1 All Unique VisitsIn the above table I want to create a "new Variable" in SQL based on combination of var1 and var2?For example if var1=tov2009 and var2=lead01 then new variable=Free Trial ButtonsAny idea how to do it?Thanks. |
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2010-09-28 : 13:29:03
|
select other_columns, case when var1=tov2009 and var2=lead01 then 'Free Trial Buttons' else NULL end as new_col from your_tableMadhivananFailing to plan is Planning to fail |
 |
|
|
|
|