hi
one thing you can do is ..use case statement case when leftjoincolumn is null then 0 else 1 end
hope it helps