I have a query that searches for a movie by title, actors, description, etc. and orders results for films that have a search term in the title.
select movie.id, movie.title
from movie
where
title like '%searchTerm%' or
cast like '%searchTerm%' or
director like '%searchTerm%' or
FullPlot like '%searchTerm%'
order by (title like '%searchTerm%') desc
Now I have a new table called "AlsoKnownAs". This table contains information about which films are called in other languages. Example Cidade De Deus (2003) AKA City Of God (2003)
I need to also look for this new table while I search for a movie and sort it as secondary. therefore, films containing searchTerm in the AKA table will appear after films containing searchTerm in the title.
I am not sure how to do this. It seems I need to save the term found in a variable so that I can order it.
any help is appreciated
AlsoKownAs table
'id', 'int(11)', 'NO', 'PRI', NULL, 'auto_increment'
'movieId', 'varchar(10)', 'NO', '', NULL, ''
'aka', 'varchar(305)', 'NO', '', NULL, ''
'country', 'varchar(100)', 'YES', '', NULL, ''