Welcome to dbFreaks.com!
FAQFAQ      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

Update query

 
   Database Help (Home) -> Datamining RSS
Next:  Arithmetic overflow error converting numeric to d..  
Author Message
luiz horacio

External


Since: Aug 31, 2003
Posts: 3



(Msg. 1) Posted: Fri Dec 12, 2003 3:01 am
Post subject: Update query
Archived from groups: microsoft>public>sqlserver>datamining (more info?)

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.DeleteThis@iname.com

 >> Stay informed about: Update query 
Back to top
Login to vote
Derek Shi

External


Since: Sep 02, 2003
Posts: 6



(Msg. 2) Posted: Fri Dec 12, 2003 3:01 am
Post subject: Update query [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

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


 >-----Original Message-----
 >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
 >
 >
 >
 >.
 ><!-- ~MESSAGE_AFTER~ -->

 >> Stay informed about: Update query 
Back to top
Login to vote
luiz horacio

External


Since: Aug 31, 2003
Posts: 3



(Msg. 3) Posted: Fri Dec 12, 2003 8:35 pm
Post subject: Re: Update query [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Hi Derek,

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

Regards,



--
Luiz Horacio
lhoracio RemoveThis @iname.com


"Derek Shi" <drkshih RemoveThis @hotmail.com> escreveu na mensagem
news:011f01c3c07f$11f40450$a001280a@phx.gbl...
 > 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
 >
 >
  > >-----Original Message-----
  > >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
  > >
  > >
  > >
  > >.
  > ><!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: Update query 
Back to top
Login to vote
Richard Morey

External


Since: Jan 21, 2004
Posts: 17



(Msg. 4) Posted: Fri Dec 12, 2003 8:35 pm
Post subject: Re: Update query [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

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



 >
 > "Derek Shi" <drkshih DeleteThis @hotmail.com> escreveu na mensagem
 > news:011f01c3c07f$11f40450$a001280a@phx.gbl...
  > > 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
  > >
  > >
   > > >-----Original Message-----
   > > >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
   > > >
   > > >
   > > >
   > > >.
   > > >
 >
 ><!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: Update query 
Back to top
Login to vote
luiz horacio

External


Since: Aug 31, 2003
Posts: 3



(Msg. 5) Posted: Sat Dec 13, 2003 2:31 am
Post subject: Re: Update query [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Hi Richard,

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


Regards,


Luiz Horacio


"Richard Morey" <rwmorey71.TakeThisOut@hotmail.com> escreveu na mensagem
news:u6Wmc1OwDHA.2448@TK2MSFTNGP12.phx.gbl...
 > 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
 >
 >
 >
  > >
  > > "Derek Shi" <drkshih.TakeThisOut@hotmail.com> escreveu na mensagem
  > > news:011f01c3c07f$11f40450$a001280a@phx.gbl...
   > > > 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
   > > >
   > > >
   > > > >-----Original Message-----
   > > > >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
   > > > >
   > > > >
   > > > >
   > > > >.
   > > > >
  > >
  > >
 >
 ><!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: Update query 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
Update serial number in database - Hi, I want to update specific fields in a existing table in SQL database as below example: L240100001-LG L240100002-LG *serial number is difficult to update one by one L240100003-LG L240100004-LG L240100005-LG change to L240100001-L L240100002-L..

Trying to cut down query times - I have a query that is based on two other queries that are based on tables in a database. All of the queries that are used for this final query use grouping and totals. In the application I am making, I need to choose a date range to select the subset....

Help w/query pls - Hi, I need to display on a monthly basis the policies sold showing the results in a row from their start date to the end date based on the following data: policy_cost, date_start and date_end Column one should display the first month (date_start)....

How to do updates upon the query results - Hello, I've run a complex SELECT statement combined of the several tables, which returns me: MemberID MemberName CurrentWeightAvailableOn010108 NeedsToHaveWeightOnDate Modifier(NeedsToHaveWeight-CurrentWeightAvailable) 1 John Doe ...

singleton query agains OLAP based model? - Hi, I have created a decision tree DM model from a cube. now I try the singleton query, but how to create the query???? the only samples I found works against an RDBMS model. so I'm not sure how to write my query: SELECT flattened [Test Dec..
   Database Help (Home) -> Datamining All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]