Im having a sorting problem with our intranet news-system. It has the actual news and replies stored in different tables, and i would like it to show the latest piece of news or the one that has the latest reply first (like in here). But the problem comes when i try to order the query.
SELECT * from news LEFT JOIN replies ON replies.news_id=news.id ORDER BY replies.date DESC, news.date DESC
Problem lies with the fact that not all news have any replies, so the database returns null as replies.date for those, which is sorted before any "real" date. Is there some way i could "set" those null fields as something like 1.1.1900 or so? or is there some way to get around it? Im using postgre 8... I could do the sorting in PHP i guess, but it gets a lot more complicated that way...