mysql - where is the fault in my sql code? -
'select * t1 join t2 on t1.wid = t2.wid t2.wid null limit ' . $number;
this code nothing returns me why not take values back??
join t2 on t1.wid = t1.wid
did mean that? or mean t1.wid = t2.wid? in case you'd want left join.
edit
okay, fixed it. won't show results unless there rows in t2 have wid matches row in t1 same wid.
if want results, change this:
'select * t1 left join t2 on t1.wid = t2.wid t2.wid null limit ' . $number;
next edit
if goal update t2 values t1 aren't in t2, this:
'insert t2 select t1.* t1 left join t2 on t1.wid = t2.wid t2.wid null limit ' . $number;
the missing step return t1's results, , insert them t2.
Comments
Post a Comment