Re: SQL statement

From: Steve <stevenmgarcia_at_hotmail.com>
Date: 30 Oct 2001 22:24:13 -0800
Message-ID: <4c049a8c.0110302224.141909a1_at_posting.google.com>


"Stjepan Brbot" <Stjepan.Brbot_at_ZG.HiNet.HR> wrote in message news:<9rn7uo$57b9$4_at_as201.hinet.hr>...
> 1) I have two tables: tableA,tableB
> 2) tableA has columns: colA1,colA2; tableB has columns: colB1,colB2
> 3) realtion tableA.colA1=tableB.ColB1
>
> I want to set colA2 to zero of every row if i.e. it's corresponding
> colB2 begins with letter 'A'
>
> What is the SQL statement?

update tableA set colA2 = 0 where colA1 in (select colA1 from tableA, tableB where tableA.colA1=tableB.colb1 and tableb.colb2 like 'A%');

I think this should work. Received on Wed Oct 31 2001 - 07:24:13 CET

Original text of this message