Re: Problem With SQL UPDATE
- From: Erland Sommarskog <esquel@xxxxxxxxxxxxx>
- Date: Fri, 15 Feb 2008 22:33:33 +0000 (UTC)
SAM (saberb@xxxxxxxxxxx) writes:
HI,
I got this result
Table 1
Col1 Col2 Col3 Col4 Col5
10 4001 F1 1 S
10 4001 F1 1 S
10 4003 F5 3 NULL
but
my required results is
Table 1
Col1 Col2 Col3 Col4 Col5
10 4001 F1 1 S
10 4001 F1 1 P<--------
10 4003 F5 3 NULL
i want a 'P' en the second record not a 'S'
I think you need to explain not only what you want, but also why you want
it. Why would the result be S in one case and P in the other? What does
the columns represent?
The best approach to get good answers for such questions is to post:
o CREATE TABLE statments for your tables. Don't forget to indicate keys.
o INSERT statements with sample data.
o The desired result given the sample.
o A short narrative describing your problem.
With the first three it's to copy and paste into a query editor to
develop a tested query. Also having tables, sample data and narrative
helps to understand the problem.
--
Erland Sommarskog, SQL Server MVP, esquel@xxxxxxxxxxxxx
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
.
- References:
- Problem With SQL UPDATE
- From: SAM
- Re: Problem With SQL UPDATE
- From: David Portas
- Re: Problem With SQL UPDATE
- From: SAM
- Problem With SQL UPDATE
- Prev by Date: Re: Problem With SQL UPDATE
- Next by Date: Re: SQL Server Performance Issue
- Previous by thread: Re: Problem With SQL UPDATE
- Next by thread: Re: Problem With SQL UPDATE
- Index(es):
Relevant Pages
|
Loading