SELECT 2 ROWS FROM JOIN [closed]
up vote
-4
down vote
favorite
everyone.
I have the following query:
SELECT * FROM actor_mov
INNER JOIN actor on actor_mov.aid = actor.aid
INNER JOIN movie on actor_mov.mid = movie.mid
WHERE actor.aname LIKE '%alvin%' OR
movie.name LIKE '%alvin%'
I would like to search for actor name and movie name at the same time. But its only possible the search movie names. How should I improve my query.
the goal is: serach for titanic or for Leonardo di caprio and both times get the movie data from titanic
Image to data
The Problem here is also that I get 4 Results instead of 1.
My Tables are Actor, Movie and actor movie as connection table
php mysql
closed as unclear what you're asking by Strawberry, Madhur Bhaiya, Hovercraft Full Of Eels, tripleee, Progman Nov 18 at 13:21
Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
add a comment |
up vote
-4
down vote
favorite
everyone.
I have the following query:
SELECT * FROM actor_mov
INNER JOIN actor on actor_mov.aid = actor.aid
INNER JOIN movie on actor_mov.mid = movie.mid
WHERE actor.aname LIKE '%alvin%' OR
movie.name LIKE '%alvin%'
I would like to search for actor name and movie name at the same time. But its only possible the search movie names. How should I improve my query.
the goal is: serach for titanic or for Leonardo di caprio and both times get the movie data from titanic
Image to data
The Problem here is also that I get 4 Results instead of 1.
My Tables are Actor, Movie and actor movie as connection table
php mysql
closed as unclear what you're asking by Strawberry, Madhur Bhaiya, Hovercraft Full Of Eels, tripleee, Progman Nov 18 at 13:21
Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
3
Welcome to Stack Overflow! Please provide a relevant and minimal sample data showcasing your requirements, and expected output. Please go through this link once: Why should I provide an MCVE for what seems to me to be a very simple SQL query?
– Madhur Bhaiya
Nov 18 at 12:15
add a comment |
up vote
-4
down vote
favorite
up vote
-4
down vote
favorite
everyone.
I have the following query:
SELECT * FROM actor_mov
INNER JOIN actor on actor_mov.aid = actor.aid
INNER JOIN movie on actor_mov.mid = movie.mid
WHERE actor.aname LIKE '%alvin%' OR
movie.name LIKE '%alvin%'
I would like to search for actor name and movie name at the same time. But its only possible the search movie names. How should I improve my query.
the goal is: serach for titanic or for Leonardo di caprio and both times get the movie data from titanic
Image to data
The Problem here is also that I get 4 Results instead of 1.
My Tables are Actor, Movie and actor movie as connection table
php mysql
everyone.
I have the following query:
SELECT * FROM actor_mov
INNER JOIN actor on actor_mov.aid = actor.aid
INNER JOIN movie on actor_mov.mid = movie.mid
WHERE actor.aname LIKE '%alvin%' OR
movie.name LIKE '%alvin%'
I would like to search for actor name and movie name at the same time. But its only possible the search movie names. How should I improve my query.
the goal is: serach for titanic or for Leonardo di caprio and both times get the movie data from titanic
Image to data
The Problem here is also that I get 4 Results instead of 1.
My Tables are Actor, Movie and actor movie as connection table
php mysql
php mysql
edited Nov 18 at 12:23
asked Nov 18 at 12:12
YBC INC
11
11
closed as unclear what you're asking by Strawberry, Madhur Bhaiya, Hovercraft Full Of Eels, tripleee, Progman Nov 18 at 13:21
Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
closed as unclear what you're asking by Strawberry, Madhur Bhaiya, Hovercraft Full Of Eels, tripleee, Progman Nov 18 at 13:21
Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
3
Welcome to Stack Overflow! Please provide a relevant and minimal sample data showcasing your requirements, and expected output. Please go through this link once: Why should I provide an MCVE for what seems to me to be a very simple SQL query?
– Madhur Bhaiya
Nov 18 at 12:15
add a comment |
3
Welcome to Stack Overflow! Please provide a relevant and minimal sample data showcasing your requirements, and expected output. Please go through this link once: Why should I provide an MCVE for what seems to me to be a very simple SQL query?
– Madhur Bhaiya
Nov 18 at 12:15
3
3
Welcome to Stack Overflow! Please provide a relevant and minimal sample data showcasing your requirements, and expected output. Please go through this link once: Why should I provide an MCVE for what seems to me to be a very simple SQL query?
– Madhur Bhaiya
Nov 18 at 12:15
Welcome to Stack Overflow! Please provide a relevant and minimal sample data showcasing your requirements, and expected output. Please go through this link once: Why should I provide an MCVE for what seems to me to be a very simple SQL query?
– Madhur Bhaiya
Nov 18 at 12:15
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
3
Welcome to Stack Overflow! Please provide a relevant and minimal sample data showcasing your requirements, and expected output. Please go through this link once: Why should I provide an MCVE for what seems to me to be a very simple SQL query?
– Madhur Bhaiya
Nov 18 at 12:15