Most certainly @keibah....I agree with you. Not all cooked foods last longer than raw foods, except your definition of raw differs from ours. In fact drawing from my personal experiences with kitchen activities, raw foods last way longer than cooked foods.
If we were to rule out freezing and other forms of proper food preservation, then the majority of cooked foods will last only a couple of hours as supposed to raw foods. Most cooked foods kept enclosed without air gets spoilt very quickly. On the other hand, I buy and store raw foods without exercising any special preservation and they tend to last for months without any sign of getting spoilt. Take rice for instance. Raw rice can be stored for months in a dry place and it won't get spoilt. But cooked rice get spoilt without freezing or heating every now and then.