I am making a search feature for a Job listing website. For that I need to first show the listings with matching titles and then the job listings with matching description. Here is the query, I am using right now:
Example:
(SELECT * FROM `jobs` WHERE title LIKE '%java%developer%')
UNION DISTINCT
(SELECT * FROM `jobs` WHERE description LIKE '%java%developer%')
However, I also need to sort the results by the timestamp so as to show the latest results first. Like it should give the results with matching titles sorted by timestamp and then the the listings with matching description sorted by timestamp.