Re: Update query help

2006-12-06 Thread Remo Tex
Ravi Kumar. wrote: Dear Friends, I have two tables: T1, T2. T1 has 3 columns: playerid, gameid, score T2 has 2 columns: playerid, totalscore. I wish to update table T2 such that sum of T1.score of each player, gets updated in T2.totalscore. It may be something like this: update T2, T1 s

Re: Update query help

2006-12-06 Thread Remo Tex
day, December 06, 2006 4:11 PM Subject: Update query help Dear Friends, I have two tables: T1, T2. T1 has 3 columns: playerid, gameid, score T2 has 2 columns: playerid, totalscore. I wish to update table T2 such that sum of T1.score of each player, gets updated in T2.totalscore. It may be som

Re: Update query help

2006-12-06 Thread ViSolve DB Team
4:11 PM Subject: Update query help Dear Friends, I have two tables: T1, T2. T1 has 3 columns: playerid, gameid, score T2 has 2 columns: playerid, totalscore. I wish to update table T2 such that sum of T1.score of each player, gets updated in T2.totalscore. It may be something like this: upda

Update query help

2006-12-06 Thread Ravi Kumar.
Dear Friends, I have two tables: T1, T2. T1 has 3 columns: playerid, gameid, score T2 has 2 columns: playerid, totalscore. I wish to update table T2 such that sum of T1.score of each player, gets updated in T2.totalscore. It may be something like this: update T2, T1 set T2.totalscore = sum(

Re: Need Update Query Help (Urgent)

2006-02-20 Thread Peter Brawley
I wrote this below Query but it shows error how to write UPDATE table_1 SET col_3 = 'bbb' WHERE col_1 = (SELECT max(col_1) FROM table_1) See the docs for Update at http://dev.mysql.com/doc/refman/5.0/en/update.html. You cannot refer to the update table in a subquery. PB - Veerabhad

Re: Need Update Query Help (Urgent)

2006-02-20 Thread Jeff Shapiro
On Monday 20 February 2006 03:27, Veerabhadrarao Narra wrote: > Hi > > i ahve one table table_1 and columns like col_1,col_2,col_3 > > col_1 col_2 col_3 > 1 aa aaa > 2 bb > > Now i want to update my table table_1 SET col_3 as bbb where max of col_1 > > I wrote thi

Need Update Query Help (Urgent)

2006-02-20 Thread Veerabhadrarao Narra
Hi i ahve one table table_1 and columns like col_1,col_2,col_3 col_1 col_2 col_3 1 aa aaa 2 bb Now i want to update my table table_1 SET col_3 as bbb where max of col_1 I wrote this below Query but it shows error how to write UPDATE table_1 SET col_3 = 'bbb'

RE: Update query help

2004-11-05 Thread Jeff McKeon
Yeah I thought of that but was hoping not to have to use a temp table. Thanks! Jeff -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Friday, November 05, 2004 9:25 AM To: Jeff McKeon Cc: [EMAIL PROTECTED] Subject: Re: Update query help Break it down into two

Re: Update query help

2004-11-05 Thread SGreen
Break it down into two steps. Compute your new values by customerid, then update your customer table with your computed data. CREATE TEMPORARY TABLE tmpFirstTran SELECT CustID, min(Datestamp) as mindate from Transactions group by CustID; update Customer c INNER JOIN tmpFirstTran ft ON ft.CustID

Update query help

2004-11-05 Thread Jeff McKeon
I have two tables. One has a list of customers. The other has a record of customer transactions including unix datestamps of each transaction. I've added a field to the customer table called "First_Transaction" I want to update this field with the datestamp of the first transaction for each cust