如何将以下查询的结果存储到另一个表中。考虑到已经创建了一个适当的表。
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;
您可以使用INSERT INTO TABLE SELECT....语法:
INSERT INTO TABLE SELECT
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;