problems with mysql "or"

Posted by Simon on Stack Overflow See other posts from Stack Overflow or by Simon
Published on 2010-03-11T18:38:45Z Indexed on 2010/03/11 18:39 UTC
Read the original article Hit count: 331

Filed under:

i have a problem with "and" "or" syntax!!! here is my query. . .

SELECT

`act1`.`name`,
`act1`.`surname`,
`act2`.`name`,
`act2`.`surname`,
`act3`.`name`,
`act3`.`surname`

FROM videos, actors AS act1, actors AS act2, actors AS act3 WHERE videos.ident = 'somethink' AND ( act1.id = videos.id_actor1 OR act2.id = videos.id_actor2 OR act3.id = videos.id_actor3 )

it returns me all variations of {name, surname}, but why!!! i want the name and surname of first axactly, second and thirth, if they exist!!! halp me please

© Stack Overflow or respective owner

Related posts about mysql