mysql - Column 'Hits' in field list is ambiguous -
i got sql code can not work:
insert t_ruleid(logdate,month,hour,ruleid,hits,host,cdn_id) select b.logdate,b.month,b.hour,b.ruleid,b.hits,b.host,b.cdn_id t_ruleid_back b on duplicate key update hits=hits+b.hits;
it got error column 'hits' in field list ambiguous
how can make work?
thanks!
normally, use values()
value of passed in:
insert t_ruleid(logdate, month, hour, ruleid, hits, host, cdn_id) select b.logdate, b.month, b.hour, b.ruleid, b.hits, b.host, b.cdn_id t_ruleid_back b on duplicate key update hits = hits + values(hits);
i'm not sure b.hits
generate specific error though.
Comments
Post a Comment