» Quick Links
You can make money on these forums
We Share profits with you
Google
Google Adsense
Google Adwords
YPN
Yahoo
MSN Search
Web Directories
Web Hosting
Web Hosting Offers
Hosting News
Suggestions
Link Building
Domain Names
PHP Forums
MySQL Forums
» More Links
OSP News
Reseller Hosting
Shared Hosting
Dedicated Servers
Google Adsense
Search Engine Marketing
Link Development
Affiliate Marketing


» Advertising
Multiple DC PR Check

Free SEO Tools


Go Back   Webmaster Forums > Website Developement / Programming > MySQL Forums

MySQL Forums Share Your Ideas and Tips about MYSQL. Ask questions about MYSQL. Table Design and Much More...

Reply
 
Thread Tools Display Modes
  #1  
Old 08-03-2006, 09:26 AM
Gillian Gillian is offline
Junior Member
 
Join Date: Aug 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
Gillian is on a distinguished road
Default multiple fields issue!!

Hi all:
I have a table having multiple fields, but this fields can have the same values as the folowing

Table 1
|----------------------------|
| Field1 | Field 2 | Field 3 |
|----------------------------|
| 1 | 2 | 1 |
|--------|---------|---------|
| 2 | 1 | 2 |
|----------------------------|


In another table, I put the description of the field like this

Table 2
|------------------|
| Field1 | Field 2 |
|------------------|
| 1 | One |
|--------|---------|
| 2 | Two |
|------------------|

i wana make the select statement showing the description of each field in the Table 1.

The output should be like this

|----------------------------|
| Field1 | Field 2 | Field 3 |
|----------------------------|
| One | Two | One |
|--------|--------- -- This message may have been cut off and the rest will only be shown to members. To become a member, click here --
Reply With Quote
Revenue Sharing Ads ( ?):
  #2  
Old 08-03-2006, 09:28 AM
domin domin is offline
Senior Member
 
Join Date: Jul 2006
Posts: 167
Thanks: 0
Thanked 1 Time in 1 Post
Rep Power: 17
domin is on a distinguished road
Default

try the following

SELECT t1.field2 AS Field1, t2.field2 AS Field2, t3.field2 AS field3
FROM table1 AS t0
JOIN table2 AS t1 ON t0.field1 = t1.field1
JOIN table2 AS t2 ON t0.field2 = t2.field1
JOIN table2 AS t3 ON t0.field3 = t3.field1; -- This message may have been cut off and the rest will only be shown to members. To become a member, click here --
Reply With Quote
Reply


Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Multiple DC, Multiple URL Check Tool visioninfotech Google 4 04-08-2007 05:34 AM
multiple domains on DS Zoice Dedicated Servers 1 01-24-2007 06:45 AM
Mysql_fetch_array issue, parsing most likely the issue cisco PHP Programming and Tips 1 08-28-2006 01:44 PM
retrieve multiple values parrod ASP forums and Tips 1 08-10-2006 02:11 PM
multiple databases!!! Carissa MySQL Forums 1 08-02-2006 10:53 AM


All times are GMT. The time now is 10:57 PM.