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

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

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 (NLID)

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

2006-03-16 Thread Ing. Edwin Cruz
:[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 mysql COLUMN2= '[EMAIL PROTECTED

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

2006-03-16 Thread SGreen
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 mysql COLUMN2= '[EMAIL PROTECTED]') where COLUMN1='[EMAIL PROTECTED]'; ERROR 1064

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

2006-03-16 Thread Truong Tan Son
, 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... update TABLE1 a INNER JOIN TABLE2 b on a.id = b.other_id set a.FIELD1=b.FIELD2 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

Re: Update select fields in all rows

2004-09-14 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

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

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

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

RE: an update select question

2003-11-05 Thread Chris
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 get the userid

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

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
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 ON a.id = b.id; REPLACE INTO b (Col1, Col2, Col3) SELECT * FROM

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 into table

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

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 of

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

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