INSERT INTO registration( name, email, username) values('eswar',(select email from registration),'manikandan')
答案 0 :(得分:2)
正确的语法是这样的:
INSERT INTO registration( name, email, username)
SELECT 'eswar', email, 'manikandan' FROM registration
这会插入n行(注册表中的行数)。
要对此进行过滤,请在select语句中添加约束。
INSERT INTO registration( name, email, username)
SELECT 'eswar', email, 'manikandan' FROM registration WHERE email="x@yahoo.com"
您可以将常量值添加到SELECT STATEMENT,而不是相反。
答案 1 :(得分:0)
为什么不简单地使用更新查询
UPDATE registration SET name='eswar', username = 'manikandan' WHERE email = 'email@mail.com'