My First Query is:
1--> select id from students where id in
(select student_id from mydept_it);

Table 'mydept_it' is: student_id:1,2,3,4
Table 'students' is: id:1,2,3,4

So it returns 4 rows.Its correct.

But When i run my second query with same logic, it returns empty result set.

My Second Query is:
2 -->

Table 'Dept_summary' is: dept_id:1,2,3

select dept_id from Dept_summary
where dept_id
IN(SELECT distinct replace(TABLE_NAME,'mydept_','')
FROM information_schema.tables
WHERE TABLE_NAME LIKE'mydept_%' AND table_schema='college');

Noteubquery returns - 1,2,3

So query should return Dept_ids - 1,2,3.But its returns nothing.
So i am not aware why the query give the results to one query but not to another query
But both the queries in the same logic.

But i can achive the result by using group_concat in the sub query.
But there is a memeory issue in group_concat.
So i cannot Increase memeory limit for group_concat in server .
So please give your solution to this problem without using group concat.