 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Catherine Guest
|
Posted: Thu May 17, 2007 3:10 pm Post subject: Problem UPDATE |
|
|
Hello all,
I need a help for UPDATE. I have a problem this query, I don’t know how to solve.
Example: UPDATE table1 SET value=100
Before UPDATE:
ID____Value
1_____0
2_____0
3_____0
3_____0
3_____0
4_____0
4_____0
5_____0
6_____0
After UPDATE:
ID____Value
1_____100
2_____100
3_____100
3_____100
3_____100
4_____100
4_____100
5_____100
6_____100
This isn’t good because it shows all values in each row. I want to be one ID=one Value. It means skipping row if exists double ID.
Solving likes this example, have a look:
After UPDATE:
ID____Value
1_____100
2_____100
3_____100
3_____0
3_____0
4_____100
4_____0
5_____100
6_____100
How? Thanks in advance.
Catherine. |
|
| Back to top |
|
 |
Wayne Niddery [TeamB] Guest
|
Posted: Thu May 17, 2007 11:39 pm Post subject: Re: Problem UPDATE |
|
|
Catherine wrote:
| Quote: |
I want to be
one ID=one Value. It means skipping row if exists double ID. Solving
likes this example, have a look:
After UPDATE:
ID____Value
1_____100
2_____100
3_____100
3_____0
3_____0
4_____100
4_____0
5_____100
6_____100
|
The problem is allowing there to be multiple rows with exactly same data.
Are there any other fields in these rows that makes them unique, e.g. the
two rows with ID=4, is there anything else that lets you select one of these
two rows and not the other? If not, then why are there two+ identical rows?
Also, what database are you using? This can make a difference in the
possible solutions.
--
Wayne Niddery - Winwright, Inc (www.winwright.ca)
"Reality is that which, when you stop believing in it, doesn't go
away." — Philip K. Dick |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|