现在的表 supe_spaceitems (itemid,picid),supe_attachments(aid,itemid)现在想让supe_attachments 的itemid = supe_spaceitems的itemid,应该怎么写,其中,supe_attachments的aid=supe_spaceitems的picid不熟悉两表,想不到这么痛苦,唉,请高人指教了在Mysql里直接查询的语句是否可以和在PHP里的QuerySQL一样支持查询

解决方案 »

  1.   

    以下摘自 MySQL 5.1 Reference ManualUPDATE items,month SET items.price=month.price
    WHERE items.id=month.id;
        [align=center]====  ====
    [/align]
      

  2.   

    依葫芦画瓢UPDATE supe_spaceitems,supe_attachments SET supe_attachments.itemid=supe_spaceitems.itemid
    WHERE supe_spaceitems.picid)=supe_attachments.aid;
        [align=center]====  ====
    [/align]