SitePoint Sponsor |
|
User Tag List
Results 1 to 6 of 6
-
Jan 1, 2009, 13:53 #1
importing/exporting multiple tables?
hey all,
I have three related tables that need data manually edited, I'm using phpMyAdmin to export the tables in CVS excel format for field editing, is there a way to join those tables together for export? Right now they look like this in excel;
id table1 field1
01 xxxxxxxxxx
02 xxxxxxxxxx
03 xxxxxxxxxx
id table2 field1
01 xxxxxxxxxx
02 xxxxxxxxxx
03 xxxxxxxxxx
id table3 field1
01 xxxxxxxxxx
02 xxxxxxxxxx
03 xxxxxxxxxx
I'm having a hard time editing as the tables show up one after the other, I'd like to export them like this;
id table1 field1 table2 field1 table3 field1
01 xxxxxxxxxx xxxxxxxxxx xxxxxxxxxx
02 xxxxxxxxxx xxxxxxxxxx xxxxxxxxxx
03 xxxxxxxxxx xxxxxxxxxx xxxxxxxxxx
how can this be accomplished? and how would i later import the updated fields?
I'm new to SQL and phpMyAdmin I'd really appreciate your help
-
Jan 1, 2009, 13:59 #2
- Join Date
- Jul 2002
- Location
- Toronto, Canada
- Posts
- 39,347
- Mentioned
- 63 Post(s)
- Tagged
- 3 Thread(s)
what you're asking to do is pretty complicated
may i ask why you don't just edit your tables in phpmyadmin?
how big are the edits, i.e. how many rows? how often do you need to edit all three tables?
-
Jan 1, 2009, 14:06 #3
-
Jan 1, 2009, 15:08 #4
- Join Date
- Jul 2002
- Location
- Toronto, Canada
- Posts
- 39,347
- Mentioned
- 63 Post(s)
- Tagged
- 3 Thread(s)
does each of the three tables contain the exact same number of rows with equal ids in all three tables?
-
Jan 1, 2009, 16:02 #5
-
Jan 1, 2009, 16:51 #6
- Join Date
- Jul 2002
- Location
- Toronto, Canada
- Posts
- 39,347
- Mentioned
- 63 Post(s)
- Tagged
- 3 Thread(s)
Code:SELECT t1.id , t1.field1 AS table1field1 , t2.field1 AS table2field1 , t3.field1 AS table3field1 FROM table1 AS t1 INNER JOIN table2 AS t2 ON t2.id = t1.id INNER JOIN table3 AS t3 ON t3.id = t1.id
Bookmarks