SELECT * FROM assignsubid_table INNER JOIN office_staff ON office_staff.staff_id = assignsubid_table.assignee WHERE office_staff.staff_id = '4' right join sub_activity_table ON sub_activity_table.sub_activity_id IN assignsubid_table; SELECT sub_activity_id, activity_name FROM sub_activity_table WHERE sub_activity_id IN (1, 3) SELECT A.activity_name AS activity_name , B.Subact_name AS sub_activity_id, A.City FROM sub_activity_table A, assignsubid_table B WHERE A.sub_activity_id, <> B.sub_activity_id, ORDER BY A.sub_activity_id; SELECT * FROM assignsubid_table INNER JOIN office_staff ON office_staff.staff_id = assignsubid_table.assignee INNER JOIN sub_activity_table ON sub_activity_table .status= assignsubid_table .status WHERE sub_activity_table .sub_activity_id IN (1, 6) GROUP BY sub_activity_table.sub_activity_id SELECT * FROM assignsubid_table INNER JOIN office_staff ON office_staff.staff_id = assignsubid_table.assignee INNER JOIN sub_activity_table ON sub_activity_table .status= assignsubid_table .status WHERE sub_activity_table .sub_activity_id IN (1, 6) GROUP BY assignsubid_table.task_status_id; SELECT * FROM assignsubid_table INNER JOIN office_staff ON office_staff.staff_id = assignsubid_table.assignee INNER JOIN sub_activity_table ON sub_activity_table .status= assignsubid_table .status; INNER JOIN city ON city.country_id = country.id INNER JOIN customer ON customer.city_id = city.id; SELECT task_id, GROUP_CONCAT(DISTINCT Subact_name SEPARATOR ', ') FROM assignsubid_table GROUP BY task_id; SELECT task_id ,GROUP_CONCAT(DISTINCT Subact_name SEPARATOR ', ')as Subact_name FROM assignsubid_table where task_id IN(8) GROUP BY task_id; SELECT task_id ,GROUP_CONCAT(DISTINCT Subact_name SEPARATOR ', ')as Subact_name FROM assignsubid_table where task_id IN(8) GROUP BY task_id; SELECT * FROM assignsubid_table INNER JOIN office_staff ON office_staff.staff_id = assignsubid_table.assignee INNER JOIN sub_activity_table ON sub_activity_table.sub_activity_id= assignsubid_table.Subact_name WHERE Subact_name IN(1 ) AND assignsubid_table.task_id IN(8) Personal R. Rathi SELECT * FROM assignsubid_table INNER JOIN office_staff ON office_staff.staff_id = assignsubid_table.assignee INNER JOIN sub_activity_table ON sub_activity_table.sub_activity_id= assignsubid_table.Subact_name WHERE Subact_name IN(6 ) AND assignsubid_table.task_id IN(8) SELECT * FROM assignsubid_table INNER JOIN office_staff ON office_staff.staff_id = assignsubid_table.assignee INNER JOIN sub_activity_table ON sub_activity_table.sub_activity_id= assignsubid_table.Subact_name WHERE Subact_name IN( 4 ) AND assignsubid_table.task_id IN(8) Income Tax Rectification petition B. Senthil Kumar SELECT * FROM sub_activity_table INNER JOIN sub_activity_table ON sub_activity_table.sub_activity_id= assignsubid_table.Subact_name WHERE status ='1' AND sub_activity_id='6' SELECT staff_id, GROUP_CONCAT(DISTINCT staff_name SEPARATOR ', ') as staff_name FROM office_staff where staff_id IN(4,12,10); GROUP BY office_staff.task_id $Query7= "SELECT GROUP_CONCAT(DISTINCT staff_name SEPARATOR ', ') as staff_name FROM office_staff where staff_id IN($SubStaff)"; $rowst= $ClassForm->Fetch_Result_Array($Query7); $staff= $rowst['staff_name']; SELECT * FROM assignstaffsubid_table INNER JOIN office_staff ON office_staff.staff_id = assignstaffsubid_table.assignee INNER JOIN sub_activity_table ON sub_activity_table.sub_activity_id= assignstaffsubid_table.Subact_name WHERE Subact_name IN(18) AND assignstaffsubid_table.task_id IN(142) ORDER BY task_status_id DESC