Thomas writes "Hello I have a database that contains the following tables: category category_id, category_namenews news_id, news_heading ...news_category news_id, category_id
What I am trying to do is select 10 news, but select first the ones that contain a certain word in the heading (news_heading), then the rest of the news.A query to get the first 10 results would be the following:SELECT top 10 * FROM dhn_news a, dhn_news_category b WHERE a.News_ID = b.News_ID AND b.Category_ID = 430012480 ORDER BY a.News_Date DESCIt misses the selection of the news with the keyword 'keyword' in news_heading.For instance if there were 3 news stories with the keyword in the database, it would show those 3, then 7 other results not containing the keyword; if there were none in the first selection, it would still show 10 results. If it's possible, the second set of results would not contain any results that are in the first one...In fact the main problem is that I want to use a single sql statement for that, if it's possible? We're running windows server 2003, standard edition and sql server."