select distinct link_id from join_link_object where obj_id = (select group_concat(obj_id) from xalt_object where module_name like '%intel-compilers/2016.0.047%');
+---------+
| link_id |
+---------+
| 153249 |
+---------+
返回的结果不正确。 而不是返回link_id查询列表只返回第一个。
我知道使用=不是一个好主意,我尝试使用IN但提示只是挂起并且什么都不返回。
虽然单独运行子查询然后运行主查询及其结果会得到正确的结果(手动验证)。
mysql> select group_concat(obj_id) from xalt_object where module_name like '%intel-compilers/2016.0.047%';
+-------------------------------------------+
| group_concat(obj_id) |
+-------------------------------------------+
| 352304,352305,352306,352307,352308,354813 |
+-------------------------------------------+
select distinct link_id from join_link_object where EXISTS (select obj_id from xalt_object where module_name like '%intel-compilers/2016.0.047%');
请指教! 谢谢
I know this is a very stupid thing to ask, and believe me I tried everything. This is my last resort.
I am trying to run a subquery. Surprisingly mysql hangs (even though its not a big query).
I am trying to run this query to return me a list of Link_ids
select distinct link_id from join_link_object where obj_id = (select group_concat(obj_id) from xalt_object where module_name like '%intel-compilers/2016.0.047%');
+---------+
| link_id |
+---------+
| 153249 |
+---------+
The result returned is not correct. Instead of returning the list of link_id query returns just the first one.
I know using = is not a good idea, I tried using IN but the prompt just hangs and returns nothing.
Although running subquery separately and then running the main query with its results gives correct results (verified manually).
mysql> select group_concat(obj_id) from xalt_object where module_name like '%intel-compilers/2016.0.047%';
+-------------------------------------------+
| group_concat(obj_id) |
+-------------------------------------------+
| 352304,352305,352306,352307,352308,354813 |
+-------------------------------------------+