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;
4 个解决方案
#1
37
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;
#2
75
if the table doesn't exist (and you e.g. don't want to create it because it may have lots of column names) you can create it on the fly...
如果表不存在(而您不想创建它,因为它可能有很多列名称),您可以在动态中创建它……
CREATE TABLE another_table SELECT /your query goes here/
创建表another_table SELECT /您的查询转到这里
#3
6
INSERT INTO another_table SELECT /*your query goes here*/
#4
#1
37
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;
#2
75
if the table doesn't exist (and you e.g. don't want to create it because it may have lots of column names) you can create it on the fly...
如果表不存在(而您不想创建它,因为它可能有很多列名称),您可以在动态中创建它……
CREATE TABLE another_table SELECT /your query goes here/
创建表another_table SELECT /您的查询转到这里
#3
6
INSERT INTO another_table SELECT /*your query goes here*/