FALCONSEYE
Programmer
I have the following:
the mgmt decided not to delete the records and just include a flag. if it's deleted is_removed becomes 1.
now the problem is the join gets screwed up when i include the is_removed condition with 0. i have 5 categories with 14 forums and only 2 topics in one forum. all of the is_removed fields are 0.
the query returns 14 results without the is_removed condition and only 1 with is_Removed condition.
what's the correct way of writing this query?
Code:
select *
from categories c, forums f, topics t
where c.category_id = f.category_id (+)
and t.forum_id (+) = f.forum_id
and ( c.is_removed = 0 and f.is_removed = 0 and t.is_removed = 0 )
the mgmt decided not to delete the records and just include a flag. if it's deleted is_removed becomes 1.
now the problem is the join gets screwed up when i include the is_removed condition with 0. i have 5 categories with 14 forums and only 2 topics in one forum. all of the is_removed fields are 0.
the query returns 14 results without the is_removed condition and only 1 with is_Removed condition.
what's the correct way of writing this query?