我有一个有 2 个字段的表。我如何从 2 个 sql 结果的结果中插入这 2 个字段。
insert into access (user,page)
(select id as user from users where id =5,
select pagename as page from pages where id =10)
2 个表之间没有关系。我不认为我可以加入。
我有一个有 2 个字段的表。我如何从 2 个 sql 结果的结果中插入这 2 个字段。
insert into access (user,page)
(select id as user from users where id =5,
select pagename as page from pages where id =10)
2 个表之间没有关系。我不认为我可以加入。
insert into access ("user", page) values
( (select id as user from users where id =5),
(select pagename as page from pages where id =10)
)
insert into access (user,page)
select users.id as user,
pages.pagename as page
from users,pages
where users.id = 5
and pages.id = 10