Variables Update einer Tabelle



Hallo,

ich habe schwierigkeiten eine Update-Klausel zu formulieren. Ich habe 2
Tabellen (TabA, TabB). Eine Spalte von TabA möchte ich nach TabB kopieren.

So siehts aus:
TabA
Col1 Col2 TabB_ID
1 1 1
2 3 1
3 4 1
4 2 1
1 2 2
2 3 2
3 1 2
4 4 2

TabB
Col1 Col2
1 NULL
2 NULL

Und so solls werden
TabB
ID Col1
1 1
2 3

Ich formuliers mal in Worten:
update TabB set Col1=TabA.Col1 wo TabA.Col2=1 und TabA.TabB_ID=aktuelle
UpdateZeile

Geht das überhaupt oder muss ich in einer Schleife jede Zeile einzeln
updaten?

tia
Stefan


.



Relevant Pages

  • Re: Query Join no unique link
    ... NrSeq seems to be different but if you do not care about that then one ... Or you can just disregard the TabB. ... (yes the join fields are the same, but I don't have a unique link between ...
    (microsoft.public.sqlserver.programming)
  • Update TabA with value fromTabB
    ... TabA is a Detail Table, Col A belong to TabA ... TabB is a Header Table, ...
    (microsoft.public.sqlserver.programming)
  • Re: Joins... Urgent
    ... >FROM TabA left join TabB on TabA.FldA = TabB.FldA ... If there is no record in TabB that matches any record in TabA, ... Come for live chats every Tuesday and Thursday ...
    (microsoft.public.access.queries)
  • Re: SQL: getting data for a null value column ??
    ... Thanks hrishy san ... so i have to take name from tabB only. ... PS: about union ... FROM taba a,tabb b where b.bbankcode=a.bankcode ...
    (comp.databases.oracle.server)
  • Re: SQL: getting data for a null value column ??
    ... > so i have to take name from tabB only. ... > o/p what i want is (without using union) ... > FROM taba a,tabb b where b.bbankcode=a.bankcode ... The UNION construct in it's basic form will select *all* ...
    (comp.databases.oracle.server)

Quantcast