Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
goligol
Posting Yak Master
128 Posts |
Posted - 2012-07-18 : 14:36:18
|
| hello,I am posting my request again in another form:I would like to change the table A below to table B. Table A is the output of the following in which fmb_io is related to moere than one miters_io. I would like to keep the distinct number of fmb_io with only and only one miters_io assigned to it. It doesnt matter what miters_io to be picked up, only want to have one to one concordance:SELECT [fmb_io],[miters_io]FROM [BLS].[IO2012].[io_concord_new]order by fmb_ioA:fmb_io miters_io1 1113351 1111A01 1114001 1119A01 1119102 1121002 1121002 1123002 112A003 113A004 1133005 1141005 1142006 1150007 2110008 2121009 2122109 2122A0B:fmb_io miters_io1 1113352 1121003 113A004 1133005 1141006 1150007 2110008 2121009 212210 |
|
|
robvolk
Most Valuable Yak
15732 Posts |
Posted - 2012-07-18 : 14:39:09
|
Does it have to be a table? (and why?) What about:CREATE VIEW B([fmb_io],[miters_io]) ASSELECT [fmb_io], MIN([miters_io])FROM [BLS].[IO2012].[io_concord_new]GROUP BY [fmb_io] |
 |
|
|
goligol
Posting Yak Master
128 Posts |
Posted - 2012-07-18 : 14:40:00
|
| of course it can be a view! I will try it right now, hope it works, thank youuuuuuuuu. |
 |
|
|
|
|
|