hello
can i insert into something values somewhat WHERE id = id?
does the WHERE statement works with the insert into statement?
insert
Moderator: General Moderators
- RobertGonzalez
- Site Administrator
- Posts: 14293
- Joined: Tue Sep 09, 2003 6:04 pm
- Location: Fremont, CA, USA
INSERT queries do not use a WHERE clause unless you are running a subquery...
Insert by itself won't work with a WHERE because you are in essence adding a row (so how could you compare a new row to something?).
I could be wrong on this.
Code: Select all
INSERT INTO table (`id`, `data`) VALUES (1, (SELECT `data` FROM table2 WHERE id = 5));I could be wrong on this.