i have two tables a,b,..with approximately 2lac records in each,..
table a
--------------------
a_id a_title
5 abc
6 xyz
table b
---------------------------
b_id a_id
123 5
123 6
i want all the records from table a having distinct a_title which matches with table b,the query i am trying is
select b.b_id, a.a_title,GROUP _CONCAT(a.id) as id from a inner join b on a.a_id=b.b_id where b.b_id=123 group by a.a_title
the above query is taking lots of time,kindly suggest an optimized way for this.
table a
--------------------
a_id a_title
5 abc
6 xyz
table b
---------------------------
b_id a_id
123 5
123 6
i want all the records from table a having distinct a_title which matches with table b,the query i am trying is
select b.b_id, a.a_title,GROUP _CONCAT(a.id) as id from a inner join b on a.a_id=b.b_id where b.b_id=123 group by a.a_title
the above query is taking lots of time,kindly suggest an optimized way for this.
Comment