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.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Help with Case Statement

Author  Topic 

mgarret
Starting Member

14 Posts

Posted - 2012-01-31 : 22:31:32
Hi all--

I have a blank column called “d1”. I want to assign a value of “X” to all the cells in that column.

create table want as
select
Q1,
Q2,
“ “ as d1 “Blank Column”,
Q3,
Q4
from data;
quit;

For d1 I want this:

Blank Column
X
X
X
X
X
X
X

I know this is not right, but this is what I’m trying to do.

(case when d1=” “ then d1= “x” )

Any help is greatly appreciated. Thanks!

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2012-01-31 : 23:00:29
are you using Microsoft SQL Server ?


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

mgarret
Starting Member

14 Posts

Posted - 2012-01-31 : 23:18:01

I am using Proc SQL in SAS, so oracle.
Go to Top of Page
   

- Advertisement -