Re: update select question

2008-04-15 Thread Ananda Kumar
update newslettercontent c set c.timestamp= (select n.publishdate from newsletter n where n.NLCID= c.NLCID); This should work. On 4/16/08, Chris W <[EMAIL PROTECTED]> wrote: > > I have the following query... > > SELECT c.NLCID, n.publishdate > FROM newsletter n > JOIN newslettersection s using

Re: update select question

2008-04-15 Thread Sebastian Mendel
Chris W schrieb: I have the following query... SELECT c.NLCID, n.publishdate FROM newsletter n JOIN newslettersection s using (NLID) JOIN newslettercontent c using(NLCID) WHERE contenttype = 1 AND n.publishdate AND c.`timestamp` = '-00-00 00:00:00' I want to run an update on newslettercon

update select question

2008-04-15 Thread Chris W
I have the following query... SELECT c.NLCID, n.publishdate FROM newsletter n JOIN newslettersection s using (NLID) JOIN newslettercontent c using(NLCID) WHERE contenttype = 1 AND n.publishdate AND c.`timestamp` = '-00-00 00:00:00' I want to run an update on newslettercontent and set its t

(SOLVED) Re: Error 1064: update .....select nested.

2006-03-16 Thread Truong Tan Son
ng Tan Son'" <[EMAIL PROTECTED]> Sent: Thursday, March 16, 2006 10:51 PM Subject: RE: Error 1064: update .select nested. AAAUUUGGGHHH!!! You used the dreaded "comma separated list" !!! ;-) A more explicit way to write the same thing posted by Sr. Cruz... upd

RE: Error 1064: update .....select nested.

2006-03-16 Thread SGreen
ECTED]' > > > Regards! > > -Mensaje original- > De: Truong Tan Son [mailto:[EMAIL PROTECTED] > Enviado el: MiƩrcoles, 15 de Marzo de 2006 07:22 p.m. > Para: mysql@lists.mysql.com > Asunto: Error 1064: update .select nested. > > > Dear Sir,

RE: Error 1064: update .....select nested.

2006-03-16 Thread Ing. Edwin Cruz
--- De: Truong Tan Son [mailto:[EMAIL PROTECTED] Enviado el: MiƩrcoles, 15 de Marzo de 2006 07:22 p.m. Para: mysql@lists.mysql.com Asunto: Error 1064: update .select nested. Dear Sir, MySQL-4.1.12 on RedHat Linux EL4: mysql> update TABLE1 set FIELD1=(select FIELD2 from TABLE2 where

Error 1064: update .....select nested.

2006-03-15 Thread Truong Tan Son
Dear Sir, MySQL-4.1.12 on RedHat Linux EL4: mysql> update TABLE1 set FIELD1=(select FIELD2 from TABLE2 where COLUMN2= '[EMAIL PROTECTED]') where COLUMN1='[EMAIL PROTECTED]'; ERROR 1064: You have an error in your SQL syntax. Check the manual that corresp onds to your MySQL server version for t

Re: Update select fields in all rows

2004-09-13 Thread Andrew Kreps
On Tue, 14 Sep 2004 01:07:53 -0400, Seth <[EMAIL PROTECTED]> wrote: > I am fairly new to MySQL and I have been trying to form a way to have select rows > numbers put back to 0, sort of like a reset in some rows of the table. > > The table is ladder_1 and I am trying to have the fields > rank,lra

Update select fields in all rows

2004-09-13 Thread Seth
I am fairly new to MySQL and I have been trying to form a way to have select rows numbers put back to 0, sort of like a reset in some rows of the table. The table is ladder_1 and I am trying to have the fields rank,lrank,wins,loss,games,percent,streak,points,kills on all the rows updated back to

Re: an update select question

2003-11-05 Thread Jason Joines
gerald_clark wrote: update employees set userid=substring(. Jason Joines wrote: I have a table called employees on a 3.23.48 server. One of it's fields is an email address (email) and one is the userid. The primary key is idnumber. I need to populate the userid field from the email ad

RE: an update select question

2003-11-05 Thread Chris
9:14 AM To: [EMAIL PROTECTED] Subject: an update select question I have a table called employees on a 3.23.48 server. One of it's fields is an email address (email) and one is the userid. The primary key is idnumber. I need to populate the userid field from the email address field. I can

Re: an update select question

2003-11-05 Thread gerald_clark
update employees set userid=substring(. Jason Joines wrote: I have a table called employees on a 3.23.48 server. One of it's fields is an email address (email) and one is the userid. The primary key is idnumber. I need to populate the userid field from the email address field. I can

an update select question

2003-11-05 Thread Jason Joines
I have a table called employees on a 3.23.48 server. One of it's fields is an email address (email) and one is the userid. The primary key is idnumber. I need to populate the userid field from the email address field. I can get the userid using: SELECT substring(per_email_address,1,instr(

Update Select Syntax

2003-07-04 Thread Chris Fowler
Hello All, What syntax for MySQL should I be looking at to solve a problem like the following: 3 Tables (oversimplified to show the problem area) individual.id individual.name individual_addresses.individual_id individual_addresses.address_id address.id address.street Although the structure is

Re: UPDATE ... SELECT FROM ... :)

2002-12-05 Thread Michael T. Babcock
temporary table, then "REPLACE" it back into "b". In case anyone wants to know how to do an UPDATE ... SELECT FROM ..., I did the equivalent of: BEGIN; ALTER TABLE b ADD Col3 ...; CREATE TABLE CopyCol3 SELECT b.id, b.Col1, b.Col2, a.Col3 FROM b LEFT JOIN a

UPDATE ... SELECT FROM ... :)

2002-12-04 Thread Michael T. Babcock
I have a table "a" with: ItemID int unsigned not null, CommID int unsigned not null I have a table "b" with: ItemID int unsigned not null I want to move CommID from table "a" to table "b". I've updated my schema to have CommID in "b" as well for now, and changed my code to insert the value in

Re: UPDATE SELECT

2001-09-18 Thread Michael Ayres
Basically mysql doesn't let you use data from one table in updating another table. If you look at the update syntax at http://www.mysql.com/doc/U/P/UPDATE.html you'll notice the lack of a very much needed FROM option. later, mike At 01:14 PM 9/18/2001 +0100, you wrote: >Hi everyone. > >I'm t

Re: UPDATE SELECT

2001-09-18 Thread Ian Barwick
On Tuesday 18 September 2001 14:14, Andrew Dixon wrote: > Hi everyone. > > I'm trying to do the following update, which someone at Macromedia gave me, > however I get a SQL error when I'm trying to use it with MySQL, any ideas > on what is wrong. A general lack of support in MySQL for this kind o

UPDATE SELECT

2001-09-18 Thread Andrew Dixon
Hi everyone. I'm trying to do the following update, which someone at Macromedia gave me, however I get a SQL error when I'm trying to use it with MySQL, any ideas on what is wrong. update general_users set rolling_total = sumUsr.rollingTotal from ( select id,sum(jan+feb+mar+apr+may+jun+jul+aug+s

update - select query

2001-04-02 Thread mysql m mysql
i need to update a row of a table taking the values of a "select ... from table1, table2 where table1.row=table2.row group by row" query. say: desc source_table; key int(10) FK column_source timestamp desc table_to_update; key int(10) column_to_update datet