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
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
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
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(
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
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
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'
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
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
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
10 matches
Mail list logo