tags:

views:

31

answers:

2

Hey Guys,

I am working on something where i have a table C with two columns Ndc and Price. All i care about the price field. it shows invalid values like 0, Null, negative. there is a left join between two tables A and B and i am getting table C from that. so Ndc values are matching and unmatching from both the tables but for that values it shows all invalid Price fields. How can i put flag on Ndc to show the unmatching Ndc Values?

Appreciate any help

Thanks

A: 

It might help if you posted the SQL you have so far. It's possible that you might be able to accomplish this with an outer join and use the rows where the value is null.

Andy
A: 

you could use a case statement like this

select case when isnull(price, 0) <= 0 then 0 else 1 end as validprice
codingguy3000