Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Microsoft SQL Server > Help with an Up...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 18 Topic 11082 of 11517
Post > Topic >>

Help with an Update Statment

by thetaamommy@[EMAIL PROTECTED] May 27, 2008 at 07:48 AM

CREATE Table CO(CustID int, OfficerSID varchar(10), OfficerRank
tinyint)

Insert Into CO
VALUES (1, 'KURT',  1)

Insert Into CO
VALUES (1, 'ALEX',  2)

Insert Into CO
VALUES (1, 'COLIN',  3)

Insert Into CO
VALUES (1, 'RUSTY',  4)

Insert Into CO

VALUES (2, 'CAL',  2)

Insert Into CO
VALUES (2, 'VIN',  4)


Insert Into CO
VALUES (3, 'FIDA',  2)

Insert Into CO
VALUES (3, 'ZOTO',  1)

Insert Into CO
VALUES (4, 'ZARA',  3)

Insert Into CO
VALUES (4, 'MAIR',  2)


Insert Into CO
VALUES (5, 'tara',  4)

Insert Into CO
VALUES (5, 'sara',  4)


I have an output table which is primarily like a temp table and then i
run my re****ts just grabbing data from this table.
This table looks like

CREATE Table tbl_Output (CustID int, OfficerSID1 varchar(10),
OfficerSID2 varchar(10))

I need this table to be populated thus
The offierSID1 needs to filled with officer who are ranked highest, be
it 1,2,3 or 4
Then comes OfficerSID2 which need to be filled with secondhighest
ranking, be it 1, 2, 3, 4
There can be two officersid with same ranking  so then both of them
would appear in hte output table

The output table is already populated with CustID. so i need update
statements to fill in the officersids

So the output needs to look like
1, Kurt, Alex
2, Cal, Vin
3, Zoto, Fida
4, Mair, Zara
5, Tara, Sara or 5, Sara, Tara
 




 18 Posts in Topic:
Help with an Update Statment
thetaamommy@[EMAIL PROTEC  2008-05-27 07:48:13 
Re: Help with an Update Statment
"Plamen Ratchev"  2008-05-27 11:30:34 
Re: Help with an Update Statment
thetaamommy@[EMAIL PROTEC  2008-05-27 08:34:12 
Re: Help with an Update Statment
"Plamen Ratchev"  2008-05-27 12:09:51 
Re: Help with an Update Statment
thetaamommy@[EMAIL PROTEC  2008-05-27 10:43:32 
Re: Help with an Update Statment
--CELKO-- <jcelko212@[  2008-05-27 14:37:03 
Re: Help with an Update Statment
"Tony Rogerson"  2008-05-28 05:22:54 
Re: Help with an Update Statment
Ed Murphy <emurphy42@[  2008-05-28 01:02:36 
Re: Help with an Update Statment
"Tony Rogerson"  2008-05-28 17:31:01 
Re: Help with an Update Statment
DA Morgan <damorgan@[E  2008-05-28 13:03:44 
Re: Help with an Update Statment
Erland Sommarskog <esq  2008-05-28 21:32:58 
Re: Help with an Update Statment
"Tony Rogerson"  2008-05-29 05:10:58 
Re: Help with an Update Statment
DA Morgan <damorgan@[E  2008-05-29 09:35:50 
Re: Help with an Update Statment
Erland Sommarskog <esq  2008-05-29 20:55:35 
Re: Help with an Update Statment
"Eric J. Holtman&quo  2008-06-03 15:17:49 
Re: Help with an Update Statment
"Tony Rogerson"  2008-05-29 05:10:18 
Re: Help with an Update Statment
--CELKO-- <jcelko212@[  2008-05-28 09:31:08 
Re: Help with an Update Statment
Ed Murphy <emurphy42@[  2008-05-31 21:35:19 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Wed Dec 3 0:55:00 CST 2008.