Re: how quick query can be

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Julia Sats

    Re: how quick query can be

    update (select b.b2 from b where b.b1 = a.a1) set a2 = b2

    Ok, now correct.
    Can you propose something quicker now ?

    <sybrandb@yahoo .comwrote in message
    news:a1d154f4.0 307202352.6fd71 3ec@posting.goo gle.com...
    "Julia Sats" <julia.sats@sym patico.cawrote in message
    news:<ijHSa.769 $1I5.141057@new s20.bellglobal. com>...
    I have two tables A(a1 number, a2 number) and B(b1 number, b2 number)
    a.a1 and b.b1 are join columns .
    I need to update values of a2 by values of b2.

    we can use such update quere
    update A set a2 = (select b.b2 from b where b.b1 = a.a1)

    Can you propose something quicker ?

    Thanks
    >
    Switch to a different database. Your query is incorrect too.
    >
    Sybrand Bakker
    Senior Oracle DBA

  • Yak

    #2
    Re: how quick query can be

    "Julia Sats" <julia.sats@sym patico.cawrote in message news:<jt%Sa.111 0$Wh.343036@new s20.bellglobal. com>...
    update (select b.b2 from b where b.b1 = a.a1) set a2 = b2
    >
    Ok, now correct.
    Can you propose something quicker now ?

    I can not see any sense in what you wan't to do, can you be more
    specific ?

    Do you just want to duplicate your table ?

    Drop Table A
    Create Table A as Select * from B

    or do you have two tabels that should have the same data after every
    change ? Then use a trigger on table A wich also changes table B

    Comment

    • Mike

      #3
      Re: how quick query can be

      mountainsports@ gmx.de (Yak) wrote in message news:<d2880e11. 0307220724.3986 515a@posting.go ogle.com>...
      "Julia Sats" <julia.sats@sym patico.cawrote in message news:<jt%Sa.111 0$Wh.343036@new s20.bellglobal. com>...
      update (select b.b2 from b where b.b1 = a.a1) set a2 = b2

      Ok, now correct.
      Can you propose something quicker now ?
      >
      >
      I can not see any sense in what you wan't to do, can you be more
      specific ?
      >
      Do you just want to duplicate your table ?
      >
      Drop Table A
      Create Table A as Select * from B
      >
      or do you have two tabels that should have the same data after every
      change ? Then use a trigger on table A wich also changes table B
      Tables A and B do not contain only by 2 fields each. At this case drop
      table A and create it again as select from B do not work. At this case
      has to be updated only one column without change other data.
      BTW select count(*) from A and select count(*) from B can be
      different.

      Comment

      Working...