Groups | Blog | Home
all groups > sql server data mining > december 2003 >

sql server data mining : Update query


Derek Shi
12/11/2003 11:10:49 PM
Isn't like this way:

update table2
set pat_id = t1.pat_id
from table1 t1
where table2.login_pat = t1.login_id

It should work.

Derek


[quoted text, click to view]
Luiz Horacio
12/12/2003 12:01:23 AM
Hi,

I'm having a problem to update values in one table.

I have one table:
table1.login_id
table1.pat_id.

I have another table:
table2.login_pat
table2.pat_id.

Table2.pat_id has values that I need to update in table1.pat_id, where
table1.Login_id = table2.login_pat

Tried a lot, but can't find how to do this query... Can someone help me?


Regards,



--
Luiz Horacio
lhoracio@iname.com


Richard Morey
12/12/2003 3:20:12 PM
Try this..


update table2
set pat_id = t1.pat_id
from table1 as t1
inner join table2 as t2
on t2.login_pat = t1.login_pat



[quoted text, click to view]

Luiz Horacio
12/12/2003 5:35:58 PM
Hi Derek,

Thanks for your attention. It didn't work, though.

Regards,



--
Luiz Horacio
lhoracio@iname.com


"Derek Shi" <drkshih@hotmail.com> escreveu na mensagem
news:011f01c3c07f$11f40450$a001280a@phx.gbl...
[quoted text, click to view]

Luiz Horacio
12/12/2003 11:31:10 PM
Hi Richard,

Thanks to you too... Unfortunately it does not work too...


Regards,


Luiz Horacio


"Richard Morey" <rwmorey71@hotmail.com> escreveu na mensagem
news:u6Wmc1OwDHA.2448@TK2MSFTNGP12.phx.gbl...
[quoted text, click to view]

AddThis Social Bookmark Button