Jump to content

Oracel Sql Pandits Please Help


Recommended Posts

Posted

i ahe 2 tables a and b

b have total 5 columns, i have to update 3 columns in a table a using 3 coulmns from b with join other 2 columns with table a


i have tried all google answers didnot find any luck

please help if you worked in real time

Posted

[quote name='massmaharaj' timestamp='1359408887' post='1303191542']
i ahe 2 tables a and b

b have total 5 columns, i have to update 3 columns in a table a using 3 coulmns from b with join other 2 columns with table a


i have tried all google answers didnot find any luck

please help if you worked in real time
[/quote]


edigo gatla english kadu gani...mana matru basha lo manchiga cheppu ardamayyela

Posted

https://forums.oracle.com/forums/thread.jspa?threadID=2243826
https://forums.oracle.com/forums/thread.jspa?threadID=399752
http://stackoverflow.com/questions/2446764/oracle-update-statement-with-inner-join

Posted

http://dba.stackexchange.com/questions/3033/how-to-update-a-table-from-a-another-table

Posted

naaku 2 tables unnayi

a table loki data ni update cheyali

btable lo data untundi

b table lo total 5 columns untayi andulo 3 columns thesukoni veli a table to update table by joining 2 b table columns with 2 a table columns

Posted

[quote name='massmaharaj' timestamp='1359409532' post='1303191614']
naaku 2 tables unnayi

a table loki data ni update cheyali

btable lo data untundi

b table lo total 5 columns untayi andulo 3 columns thesukoni veli a table to update table by joining 2 b table columns with 2 a table columns
[/quote]

aa tables madyalo amina relation unda...assalu aa tables structure veyyi ...

Posted

table a -id, start_dt,end_dt, term_dt,ind_yn ( this has history) here id and start_dt have unique combinatino
table b - id, start_dt,end_dt,term_dt,ind_yn


now i want to update end_dt,term_dt, ind_yn in table a using table b's end_dt,term_dt, ind_yn
by joining id and start_dt in a and b

Posted

[list]
[*]UPDATE A
[*]SET ( A.col2, A.col4 ) =
[*]( SELECT B.col2, B.col4
[*] FROM B
[*] WHERE B.col1 = A.col1
[*])
[*]WHERE EXISTS
[*]( SELECT B.col2, B.col4
[*] FROM B
[*] WHERE B.col1 = A.col1
[*])
[/list]

[size=3][background=white]
i got it the aboev sql i used [/background][/size]

Posted

UPDATE a
SET (a.col3, a.col4,a.col5) = (
SELECT b.col3,b.col4,b.col5
from b
WHERE b.col1 = a.col1 and b.col2=a.col2);

×
×
  • Create New...