mysql查询结果存储_如何将MySQL查询结果存储在另一个表中?

bd96500e110b49cbb3cd949968f18be7.png

How to store results from following query into another table. Considering there is an appropriate table already created.

SELECT labels.label,shortabstracts.ShortAbstract,images.LinkToImage,types.Type

FROM ner.images,ner.labels,ner.shortabstracts,ner.types

WHERE

labels.Resource=images.Resource

AND labels.Resource=shortabstracts.Resource

AND labels.Resource=types.Resource;

解决方案

You can use the INSERT INTO TABLE SELECT....syntax:

INSERT INTO new_table_name

SELECT labels.label,shortabstracts.ShortAbstract,images.LinkToImage,types.Type

FROM ner.images,ner.labels,ner.shortabstracts,ner.types

WHERE labels.Resource=images.Resource AND labels.Resource=shortabstracts.Resource

AND labels.Resource=types.Resource;


版权声明:本文为weixin_40001275原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。