MSYQL ~ 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:01 UTC
Read the original article Hit count: 152

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 mysql-query