我有这样的命令:在这种情况下,如何使用嵌套的INSERT/SELECT命令?
INSERT INTO table2 (username,profile) SELECT DISTINCT username,profile
FROM table1 WHERE profile='$profile' and username <> '$sender'
我的问题是我想这样的:INSERT INTO table2 (username,profile,type)
其中类型会是相同的字符串,说“串”
重要:我只想username
是DISTINCT。 profile
和type
可以是相同的。 另外,profile
将始终是相同的值。
我该如何做到这一点?
非常感谢,认为
嗨,实际上配置文件总是一样的。让我编辑 – alexx0186