943,630 Members | Top Members by Rank

Ad:
  • MySQL Discussion Thread
  • Marked Solved
  • Views: 1438
  • MySQL RSS
Jul 25th, 2008
0

use more than two tables

Expand Post »
hi,
i want to select from more than two table using a single mysql query.please tell me a example query/.
thanks in advance
Similar Threads
Reputation Points: 19
Solved Threads: 5
Junior Poster
lydia21 is offline Offline
183 posts
since Nov 2007
Jul 25th, 2008
0

Re: use more than two tables

you can use joins for this:
my sql Syntax (Toggle Plain Text)
  1. "select * from table1 as t1,table2 as t2 where ti.id=t2.id";

this is simple....
Have look on this url follows:
http://www.tizag.com/mysqlTutorial/mysqljoins.php
Reputation Points: 137
Solved Threads: 162
Posting Virtuoso
Shanti C is offline Offline
1,641 posts
since Jul 2008
Jul 25th, 2008
0

Re: use more than two tables

thanks.i tried this way
MySQL Syntax (Toggle Plain Text)
  1. SELECT article.id,article.ar_title,article.owner,article.ar_date,addinfo.pat,login.username
  2. FROM article
  3. LEFT JOIN (
  4. login,addinfo
  5. ) ON ( login.id = article.owner
  6. AND login.id = addinfo.userid
  7. AND article.owner = addinfo.userid )
  8. WHERE article.owner =17
  9. LIMIT 0 , 30 ORDER BY article.ar_date DESC
Reputation Points: 19
Solved Threads: 5
Junior Poster
lydia21 is offline Offline
183 posts
since Nov 2007

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in MySQL Forum Timeline: Query...errr...query
Next Thread in MySQL Forum Timeline: Mysql IsNull check





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC