Skip to content
Back to formatted view

Raw Message

Message-ID: <1345462028582-4640772.post@n4.nabble.com>
Date: 2012-08-20T11:27:08Z
From: cindy.dol
Subject: function case in sqldf (datas from oracle) with a null value

I use sqldf to join 2 dataframes from 2 distinct databases : a and b come
from old sqldf's.

sqldf("select a.*, b.*, case a.QTY when null then b.QTY else a.QTY end as
NEW_QTY" 
from a inner join b on a.OBJECT=b.OBJECT")

R doesn't understand "when null". I tried with "when NA", "when '' ", "when
' ' " but it doesn't work.



--
View this message in context: http://r.789695.n4.nabble.com/function-case-in-sqldf-datas-from-oracle-with-a-null-value-tp4640772.html
Sent from the R help mailing list archive at Nabble.com.