Dynadot โ€” .com Transfer

Sql joins

SpaceshipSpaceship
Watch

cashboy

Established Member
Impact
1
I have 2 different mysql tables.. and I want to get data from both of them through only one query.. I know it can be done using joins.. but dont know how...

can anyone help me?
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
Unstoppable Domains โ€” AI StorefrontUnstoppable Domains โ€” AI Storefront
They have to have one or more fields in common for the join. Let's say they have two fields in common; field1 and field2. Then to join the two tables (t1 and t2) together on these fields use:

SELECT *
FROM
t1
INNER JOIN
t2
ON t2.field1 = t1.field AND t2.field2 = t1.field2

An INNER JOIN returns rows from t1 and t2 where both tables have matching fields (i.e. field1 and field2).

Lots of online help around. If this doesn't help, search on yahoo for "SQL JOIN".

Cheers,
BidNo
 
0
•••
0
•••
thx BidNo for the code.... and 2ndver for the links....

ill let ya guys know if i find frther problems....
 
0
•••
Dynadot โ€” .com TransferDynadot โ€” .com Transfer
Appraise.net
Escrow.com
Spaceship
Rexus Domain
CryptoExchange.com
Domain Recover
CatchDoms
DomDB
NameFit
  • The sidebar remains visible by scrolling at a speed relative to the pageโ€™s height.
Back