The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.
|
 |
|
Dev Shed Forums
> Databases
> MySQL Help
|
Display information from 3 tables using 2 unique id
Discuss Display information from 3 tables using 2 unique id in the MySQL Help forum on Dev Shed. Display information from 3 tables using 2 unique id MySQL Help forum discussing administration, SQL syntax, and other MySQL-related topics. MySQL is an open-source relational database management system (RDBMS).
|
|
 |
|
|
|
|

Dev Shed Forums Sponsor:
|
|
|

March 6th, 2013, 06:28 AM
|
|
Registered User
|
|
Join Date: Mar 2013
Posts: 7
Time spent in forums: 1 h 48 m 8 sec
Reputation Power: 0
|
|
|
Display information from 3 tables using 2 unique id
i have 3 tables and want to use one interface to display their related information from the tables.i have 1 unique id that relates the tables.pls i need a single sql code to do that
|

March 6th, 2013, 06:30 AM
|
|
Registered User
|
|
Join Date: Mar 2013
Posts: 7
Time spent in forums: 1 h 48 m 8 sec
Reputation Power: 0
|
|
|
How to use 1 id to display data from 3 tables using one interface
i have 3 tables and want to use one interface to display their related information from the tables.i have 1 unique id that relates the tables.pls i need a single sql code to do that
|

March 6th, 2013, 06:39 AM
|
 |
SQL Consultant
|
|
Join Date: Feb 2003
Location: Toronto Canada
|
|
Code:
SELECT frabilgimjer.gromulphastic
, frabilgimjer.corbustackle
, quistipunctous.clapfrepple
, haplistplogget.whipfintaggle
FROM frabilgimjer
INNER
JOIN quistipunctous
ON quistipunctous.scrimflabat = frabilgimjer.horbliston
INNER
JOIN haplistplogget
ON haplistplogget.opsilfrummer = quistipunctous.scrimflabat
exactly what you asked for 
|

March 6th, 2013, 07:00 AM
|
|
Registered User
|
|
Join Date: Mar 2013
Posts: 7
Time spent in forums: 1 h 48 m 8 sec
Reputation Power: 0
|
|
|
@r937
what i mean is this i have
t1
*sn
*regno
*names
*college
*gender
t2
*sn
*regno
*names
*college
*gender
t3
*sn
*regno
*names
*college
*gender
and
t4
*sn
*hn
*bn
*bs
t5
*sn
*hn
*bn
*bs
t6
*sn
*hn
*bn
*bs
i need php/mysql that
if sn in t1 = sn in t4
or if sn in t2 = sn in t5
or if sn in t3 = sn in t6
it should display their related information using a single mysql query and also one page interface to relate and output them
note: i design the database schema like that with a purpose
|

March 6th, 2013, 07:08 AM
|
 |
SQL Consultant
|
|
Join Date: Feb 2003
Location: Toronto Canada
|
|
|
your first post says "i have 3 tables ... i have 1 unique id that relates the tables"
your thread title says "Display information from 3 tables using 2 unique id"
now there are 6 tables and 6 ids
you're on your own, bro
|

March 6th, 2013, 07:33 AM
|
|
Registered User
|
|
Join Date: Mar 2013
Posts: 7
Time spent in forums: 1 h 48 m 8 sec
Reputation Power: 0
|
|
|
bro,that's mistake on my side.
its actually 3 tables relating to 3 tables using 1 id ie the sn. pls help me with a single mysql query that will relate them individually
|

March 6th, 2013, 08:14 AM
|
 |
Square Peg in a Round Hole
|
|
Join Date: Oct 2007
Location: North Yorkshire, UK
|
|
|

March 6th, 2013, 08:15 AM
|
 |
SQL Consultant
|
|
Join Date: Feb 2003
Location: Toronto Canada
|
|
Quote: | Originally Posted by Northie Try: SQL INNER JOIN | you mean like in post #3 here? 
|
Developer Shed Advertisers and Affiliates
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Rate This Thread |
Linear Mode
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|