temp_table? t.f? Where did those come from, Bubikol???
And if there are only 4 records in temp_table, that will *NOT* get more than 4 records.
One simple answer:
Code:
SELECT X.* FROM
( SELECT 1 AS dummy, * FROM table
UNION
SELECT 2 AS dummy, * FROM table
) AS X
WHERE X.jobcategory LIKE '%Admin%'
ORDER BY RAND() LIMIT 5
But it's not terribly efficient.
I would be strongly tempted to do this in PHP/JSP/ASP code, instead.
Read the 4 records into an array and then just pick a random array element 5 times.