为什么此查询仅选择一行? [英] Why does this query only select a single row?
本文介绍了为什么此查询仅选择一行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
SELECT * FROM tbl_houses
WHERE
(SELECT HousesList
FROM tbl_lists
WHERE tbl_lists.ID = '123') LIKE CONCAT('% ', tbl_houses.ID, '#')
它仅从tbl_lists.HousesList
我需要它选择tbl_lists.HousesList
推荐答案
很难准确知道数据的外观,但是如果它仅与最后一个ID匹配,则可能是因为您没有任何
It's hard to tell without knowing exactly what your data looks like, but if it only matches the last ID, it's probably because you don't have any %
at the end of the string, so as to allow for the list to continue after the match.
这篇关于为什么此查询仅选择一行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文