Do we have any "PREFER" keyword or something like it? This is the seudo code of what I want: SELECT * FROM myTable Preferebly WHERE Title LIKE '%hello%' LIMIT 0,10 PHP: By which I mean: Give me 10 rows of myTable, if you can find hello in Title then include them otherwise whatever the default. At the moment I have to use 2 queries, first search for rows where their title like my keyword and then getting the rest of the rows again.
Have to say I am not the worlds greatest SQL person (and our SQL guy isnt online) but I cannot think of how to do this as a single query with a limit. You could remove the limit and then use a CASE statement to create an extra column with a 0 if the title contains hello and a 1 if it doesnt then just sort by this column. Alternatively you can do 2 queries and join the results.