1) What is the correct select statement to use in MYSQL so that it only shows the TitleName once and all the stars in a video. I have a search button for Titles and when it gets submitted it shows it not the way I want it.

So if there is a Video with TitleName=I Spy and the stars are Eddie Murphy, Kelly Robinson, Owen Wilson

In the output table I see:
I Spy Eddie Murphy
I Spy Kelly Robinson
I Spy Owen Wilson

I want to see something like this:
I SPY Eddie Murphy, Kelly Robinson, Owen Wilson
OR
I SPY Eddie Murphy
Kelly Robinson
Owen Wilson


Here is the select statement I tried but doesn't work.
SELECT TitleName, ActorName
FROM Titles
left JOIN ActorTitle ON Titles.TitleID = ActorTitle.TitleID
left JOIN Actors ON Titles.ActorID =Actors. ActorID
WHERE TitleName LIKE '%colname%'
ORDER BY TitleName ASC


Studios (StudioName, StudioID)
Genres (GenreName, GenreID)
Titles (TitleName, Details, StudioID, GenreID, BitRateID, TitleID)
Actors (ActorName, ActorID)
ActorTitle (TitleID, ActorID)
TitleGenres (TitleID, GenreID)

2) Is there a way to optimize my tables for this kind of searches?

Thank you.


---------------------------------------------------------------------
Before posting, please check:
  http://www.mysql.com/manual.php   (the manual)
  http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to