Mailing List
Home
MySQL General - General MySQL discussion
MaxDB - Everything about MaxDB, formerly known as SAP DB
MySQL on Win32 - Runing MySQL on Windows 9x/Me/NT/2000/XP
Java Help - Mostly related to the MySQL Connector/J driver
ODBC - ODBC with the MySQL Connector/ODBC driver
Perl - Perl support for MySQL with DBI and DBD::mysql
MySQL++ - Programming with the C++ API to MySQL
Subjects
mysql openssl Question
mysql:it 's a db not a dbms how it 's possible?!
Does the binary log enabling affect the MySQL performances?
Strange behavior, Table Level Permission
FULLTEXT query format question
Preventing Duplicate Entries
Comparing and writing out BLOBS
Executing MySQL Commands From Within C Program
Can 't access mysql after kernel upgrade
Mysql 4 0 Oracle Stored Procedure Trigger Conversion
Downgrade Mysql from 4 to 3 23
MySQL Cluster Software
mysql test 4 1 fails with the gis test
ERROR 2002: Can 't connect to local MySQL server through socket
Getting Identity after INSERT
Update one field with more fields from another table
ERROR 1045: Access denied for user: 'root@localhost ' (Using
password: NO)
mysql have same function mthod as Oracle decode()
 
Search:  
Power your search with and, or, +, -, or "some phrase" operators.
JOINING...

JOINING...

2004-03-22       - By David Scott

 Back
Hiya peeps.
I have a table which looks something like this:

TABLE1
id, something, page1, page2, page3
1, "wibble ", 1, 3, 5

TABLE2
id, name
1, "hello "
2, "world "
3, "why can 't "
4, "i get "
5, "this to work "

I want to SELECT everything from TABLE1 replacing the numbers in page1, 2, 3
with the words is TABLE2.

RESULT
id, something, page1, page2, page3
1, "wibble ", "hello ", "why can 't ", "this to work "

I usually just do "SELECT * FROM table1 WHERE table1.page1 = table2.id " but
this doesnt work when there are multiple pages (page1, 2, 3 in table1)

Help :S
I 've tried using joins but I can 't seem to get the syntax right...
and yes. I have read the manual, just not sire if the bit I read (joins) is
the bit I need to read
--
Dave


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=mysql @(protected)