Sponsored by NuSphere - PHP Software for PHP Application Developers - On Sale This Week for $100



Go Back   PHP-Editors > Linux, Apache, MySQL > MySQL Help

MySQL Help Post any question relating to MySQL here and hopefully someone can help

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 2008-06-25, 02:27 AM
Junior Member
 
Join Date: Jun 2008
Posts: 1
gprasanth_kumar is on a distinguished road
Default select data from three tables...

I have three tables Table_1 with a Primary Key(uid) and other tables Table_2(id) and Table_3(id) with foreign keys referencing Primary Key of table Table_1. Each one have 7-rows.

My problem is to retreive 1-st row from each table and display as a single row. I used select * from Table_1 t1,Table_2 t2, Table_3 t3 where t1.uid=t2.id and t1.uid=t3.id; but there are 49 rows being displayed in mysql...where as i would like to see the data in just 7rows...please help me....

Tanks in advance,
Prasanth Kumar G
Reply With Quote
  #2 (permalink)  
Old 2008-08-11, 05:01 PM
Member
 
Join Date: Jun 2006
Posts: 55
flann is on a distinguished road
Default

it sounds like you're doing a cartesian join. Could you post more info about the data.
__________________
flann
Free Mortgage Calculator | Debt Free
Reply With Quote
Must read Review for Serious PHP Developers


NuSphere PhpED 5.0 : The Staff of php-editors.com recently spent a few days working with NuSphere PhpED 5.0 (a popular PHP IDE) and NuCoder 1.4 (a PHP Encoding Utility), read up on all the details.

Sponsored Links
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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 12:01 PM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO 3.1.0
© Copyright 2003-2008 www.php-editors.com. The ultimate PHP Editor and PHP IDE site.