Why does this query only select a single row?

Posted by Joe on Stack Overflow See other posts from Stack Overflow or by Joe
Published on 2010-03-22T12:00:03Z Indexed on 2010/03/22 12:11 UTC
Read the original article Hit count: 336

Filed under:
|
SELECT * FROM tbl_houses WHERE (SELECT HousesList FROM tbl_lists WHERE tbl_lists.ID = '123') LIKE CONCAT('% ', tbl_houses.ID, '#')

It only selects the row from tbl_houses of the last occuring tbl_houses.ID inside tbl_lists.HousesList

I need it to select all the rows where any ID from tbl_houses exists within tbl_lists.HousesList

© Stack Overflow or respective owner

Related posts about mysql

Related posts about sql