delete from db where date="2001-04-09" and CR_amount=300.00
insert into from db (date, DB_amount, CR_amount) values ("2001-04-09", NULL,
300.00);
insert into from db (date, DB_amount, CR_amount) values ("2001-04-09", NULL,
350.00);
would change the 3rd to 350.00 credit.
Unfortunately, there is no easy way of doing this, and if the above is an
example, where the number of duplicates is much higher, then it's going to
be awkward.
you might want to try (on a backup version of the table):
alter table db add id int auto_increment primary key;
This would insert a unique key field, but I'm not sure if it would
pre-populate existing records.
If it works, you can then use the update function where id="xxx";
Hope this helps
Ben
-----Original Message-----
From: Richard Reina [mailto:[EMAIL PROTECTED]]
Sent: 09 April 2001 10:59
To: [EMAIL PROTECTED]
Subject: How update 1 of two identical rows.
Date DB_amount CR_amount
2001-04-09 NULL 300.00
2001-04-09 NULL 750.00
2001-04-09 NULL 300.00
Anyone know how can I do a query that will update the third record
without updating the first?
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php