Re: Joining one to many relational table
- From: "<!-- The F-Word --> <? echo \"General Microcephalic S. Bob\"; ?> <!-- Antisocial Interfaces --> // 270-290-291-293-294-298-299" <{ http://www.planetoftheheads.com/ - head first into the future }>
- Date: Mon, 6 Jun 2005 15:14:32 -0700
No. He should have used XMLDOM to export the data, which he could have then
imported through a recordset object and recreated the table with a MAKE
SHIFT query, and he would be happier if he would have used velveeta instead
of real cheese.
Microcephalic S. Bob
"Herb" <herbert.v@xxxxxxxxx> wrote in message
news:u4y2BLuaFHA.2516@xxxxxxxxxxxxxxxxxxxxxxx
> UPDATE Table1 SET Table1.ColumnC = 1 FROM Table1 RIGHT JOIN Table2 ON
> Table1.ColumnA = Table2.ColumnA AND Table1.ColumnB = Table2.ColumnB
>
> "sqllearner" <sqllearner@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
> news:AAD3048F-15AA-4989-9109-88404D3E18F8@xxxxxxxxxxxxxxxx
>> For Table1 the values for column1 is A,A,B,B,B and the correspoding
>> values in
>> column2 is 2,2,3,3,3 and the correspoding values in column3 is 0,0,0,0,0.
>> In
>> Table2 the values for column1 is A,B and the correspoding values in
>> column2
>> is 2,3.
>>
>> I want to update Table1.Column3 = 1, where Table1.Column1 =
>> Table2.Column1
>> and Table1.Column2 = Table2.Column2. But using joins, I found it updates
>> all
>> 5 rows in Table1.Column3. But I want to update only 2 rows in
>> Table1.Column3,
>> as Table2 has 2 rows. More specifically, I want to update one to one in
>> this
>> one to many relational tables.
>>
>>
>> "Mike T." wrote:
>>
>>> "sqllearner" <sqllearner@xxxxxxxxxxxxxxxxxxxxxxxxx> schrieb im
>>> Newsbeitrag
>>> news:82680BDA-7D58-4D78-A16B-2536F8AA0EC8@xxxxxxxxxxxxxxxx
>>> >I have two tables: Table1 has A,A,B,B,B and Table2 has A, B. I want to
>>> >join
>>> > Table1 with Table2 and update Table1, but I want to update only 1 for
>>> > A
>>> > and 1
>>> > for B in Table1. How will I do it?
>>>
>>>
>>> Are A,A,B,B,B values for one column across 5 rows in Table1? Are there
>>> other
>>> columns in Table1?
>>>
>>> For the joins, SELECT DISTINCT might be an option. For the update, I
>>> need
>>> more info.
>>>
>>> Also, to use a New York phrase: Not for nothin', but this is the MCSE
>>> group.
>>> You might have a bit more luck with one of the SQLServer groups.
>>>
>>> --
>>> Mike T.
>>> MCNGP #XLI
>>>
>>>
>>>
>
>
.
- Follow-Ups:
- Re: Joining one to many relational table
- From: FrisbeeŽ
- Re: Joining one to many relational table
- References:
- Joining one to many relational table
- From: sqllearner
- Re: Joining one to many relational table
- From: Mike T.
- Re: Joining one to many relational table
- From: sqllearner
- Re: Joining one to many relational table
- From: Herb
- Joining one to many relational table
- Prev by Date: Re: E-mail Signatures
- Next by Date: Re: Certification
- Previous by thread: Re: Joining one to many relational table
- Next by thread: Re: Joining one to many relational table
- Index(es):
Relevant Pages
|