MySQL Forums
Forum List  »  PHP

Re: Thanks, laptop alias (and Barry), here is the SHOW CREATE TABLE
Posted by: Barry Galbraith
Date: March 07, 2012 08:58PM

Unless you post some sample data as INSERT statements, and a sample of the output you want, I can only take a guess.

SELECT n.newspaper
, n.facebook
, n.twitter
, r.radio
, r.rfacebook
, r.rtwitter
-- any other columns you want go here 
FROM brasil_newspapers n
JOIN brasil_radio r
ON r.city = n.city
WHERE state='Alagoas' 
ORDER BY city 
LIMIT $offset, $rowsPerPage;

this should give results where there is both newspapers and radio in the same city.
If you want something different, then you will need to explore LEFT JOIN &c to get All newspaers, and / or all radio.

Good luck,
Barry.

Options: ReplyQuote




Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.