Maybe this is some SQL standard implementation and that's why it is what it
is, but to me it seems completely retarded that you have to explicitly call
out the columns...

http://dev.mysql.com/doc/refman/5.0/en/insert-on-duplicate.html

Why doesn't it work in a more convenient and sane way?!

So instead of this cumbersome incantation that makes you want to rip out
your hair and puch your cube-mate dead in the nose:

insert into table1 (c1,c2,c3) values (v1,v2,v3) on duplicate key
update c1=v1, c2=v2, c3=v3;

Just allow a more sane and logical:

insert into table1 (c1,c2,c3) values (v1,v2,v3) on duplicate key update;

Because if you wanted that you'd use REPLACE which is mysql specific which is okay since it's mysql you're using I guess.

And in my case, I have a stats table... I either want to insert a row with hits=1 or I want to hits=hits+1. So I need to specify what I want. And I don't want to change *any* of the other columns (such as the date for the hit or the id, etc.)

ANyway... not saying they couldn't do it both ways, but there is a reason.

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to