BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Problem UPDATE

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Databases (Desktop)
View previous topic :: View next topic  
Author Message
Catherine
Guest





PostPosted: Thu May 17, 2007 3:10 pm    Post subject: Problem UPDATE Reply with quote



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





PostPosted: Thu May 17, 2007 11:39 pm    Post subject: Re: Problem UPDATE Reply with quote



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
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Databases (Desktop) All times are GMT
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.