chestertb
03-16-2004, 05:29 PM
Hi all,
I was wondering whether I have missed something the SQL tutorials...
The syntax for INSERT seems to be
INSERT into filename (field1, field2 etc)
VALUES ('x','y' etc)
The syntax for UPDATE seems to be
UPDATE file SET field1 = 'x',
field2 = 'y'
WHERE somecondition
That just seems clumsy, to have two different structures for what are essentially variations of the same task.
Can I use something like this?
INSERT into filename SET field1 = 'x',
field2 = 'y'
(it returned a syntax error)
It would make the query much easier to read.
Cheers
CTB
I was wondering whether I have missed something the SQL tutorials...
The syntax for INSERT seems to be
INSERT into filename (field1, field2 etc)
VALUES ('x','y' etc)
The syntax for UPDATE seems to be
UPDATE file SET field1 = 'x',
field2 = 'y'
WHERE somecondition
That just seems clumsy, to have two different structures for what are essentially variations of the same task.
Can I use something like this?
INSERT into filename SET field1 = 'x',
field2 = 'y'
(it returned a syntax error)
It would make the query much easier to read.
Cheers
CTB