Have as many UNIONS as you like, the amount of UNION statements should be the array length-1.
By default they return distinct but if the key_word_index bit I said before is used then you will be back to sqaure one( always forget that ). You will have to follow the example here
http://dev.mysql.com/doc/refman/5.0/en/union.html
SELECT song_id FROM
(SELECT song_id FROM play_immediate
ORDER BY play_id DESC) AS t1
UNION
SELECT song_id FROM
(SELECT song_id FROM play_later
ORDER BY play_id) AS t2
To get them to come out in the order the keywords were entered if it is important.
eg
(
SELECT id, title FROM table WHERE (column1 LIKE '%$keyword%' OR column2 LIKE '%$keyword%')
)
UNION
(
SELECT id, title FROM table WHERE (column1 LIKE '%$keyword%' OR column2 LIKE '%$keyword%')
)
UNION
(
SELECT id, title FROM table WHERE (column1 LIKE '%$keyword%' OR column2 LIKE '%$keyword%')
) ORDER BY id
will return distinct but does no care about the order of the keywords were entered. Ie if I type monkey as my first keyword is it important that the monkey results are first in the list?
UNIONS get a bit tricky and are hard to do without the database beyond the top example due to having to work around not being able to use the GROUP BY clause before the last ORDER BY. They always catch me out for bigger things but come in very useful, but often what I mentally assume to work needs to be played with.
What it sounds like what you are doing is an older version of a tag cloud engine as a tag is pretty much the new fangled name of keyword. Could use a like clause on the tag list. Though tag clouds can get more head banging as well 🙂