Search the Community
Showing results for tags 'multi table'.
Found 1 result
Hi all ! The query below works great. However I have moved the table_1.city field into a new table, namely, table_3. $query = "SELECT xid, bb.fname, bb.lname, bb.city, bb.cell, bb.email, bb.fid, bb.cno, bb.total, bb.actic from tmp_table INNER JOIN ( SELECT table_1.fname, table_1.lname, table_1.free_id, table_1.city, table_1.cell, table_1.email, table_2.fid, table_2.cenno, count(fid) total, sum(case when scr = 'R' then 1 else 0 end) actic From table_2, table_1 WHERE table_2.fid = table_1.free_id GROUP by table_2.fid, table_2.cenno ORDER by actic DESC LIMIT ?, ? ) bb ON bb.free_id = tmp_admin.xid"; How can I change the query to incorporate this change ? i.e. I need to draw the value of city from table_3. Thanks & a very happy new year to all !