LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 02-03-2004, 03:12 AM   #1
gruessle
Member
 
Registered: Dec 2003
Location: USA
Distribution: Debian
Posts: 40

Rep: Reputation: 15
UPDATE multiple mySQL tables


I know this is easy for most of you but I been googling all over the place for help on this.

I have two tables and a text file
In the text file I have

products_model, products_description

The Tables look like this:
Table_1: products_id, products_model, etc. etc.
Table_2: products_id, products_description, etc. etc.

How can I UPDATE products_description in Table_2 WHERE products_model in Table_1 matches to the text file products_model.
 
Old 02-03-2004, 07:41 AM   #2
Strike
Member
 
Registered: Jun 2001
Location: Houston, TX, USA
Distribution: Debian
Posts: 569

Rep: Reputation: 31
Er, I'm assuming these are linked by products_id, so:

Code:
UPDATE Table_2
SET products_description = <whatever>
WHERE Table_2.products_id = Table_1.products_id
      AND Table_1.products_module = "<value you get from text file>"
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
connecting and reusing existing mysql permissions/dbs/tables after update deesto *BSD 0 10-29-2005 03:46 PM
mysql reinstallation distorted by previous tables in /var/mysql mad4linux Linux - Software 0 10-04-2005 01:39 PM
API for using multiple routing tables on Linux Shakesh Linux - Networking 0 08-29-2005 05:45 PM
IP tables routing of multiple IP addresses 2buck56 Linux - Security 4 05-11-2005 05:06 PM
SQL: making queries from multiple tables ganninu Programming 1 01-08-2004 11:17 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 11:48 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration