Skip navigation links

MySQL Forums :: PHP :: Able to select multiple tables with manually generated (primary) keys, but not auto-numbered ones


Advanced Search

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


Subject Written By Posted
Able to select multiple tables with manually generated (primary) keys, but not auto-numbered ones Kurt Wayne 03/03/2012 11:51AM
UPDATE: I've tried "UNION SELECT" and it's getting warmer Kurt Wayne 03/03/2012 05:16PM
Re: UPDATE: I've tried "UNION SELECT" and it's getting warmer Kurt Wayne 03/05/2012 09:29AM
Re: UPDATE: I've tried "UNION SELECT" and it's getting warmer Barry Galbraith 03/05/2012 03:57PM
Re: UPDATE: I've tried "UNION SELECT" and it's getting warmer Kurt Wayne 03/07/2012 10:22AM
Re: UPDATE: I've tried "UNION SELECT" and it's getting warmer laptop alias 03/07/2012 10:24AM
Thanks, laptop alias (and Barry), here is the SHOW CREATE TABLE Kurt Wayne 03/07/2012 08:16PM
Re: Thanks, laptop alias (and Barry), here is the SHOW CREATE TABLE Barry Galbraith 03/07/2012 08:58PM
Barry Galbraith, here is some additional information Kurt Wayne 03/08/2012 12:54PM
Re: Barry Galbraith, here is some additional information Barry Galbraith 03/08/2012 05:09PM
Re: Barry Galbraith, here is some additional information Kurt Wayne 03/09/2012 06:11PM
Re: Barry Galbraith, here is some additional information Barry Galbraith 03/10/2012 12:27AM
Re: Barry Galbraith, here is some additional information Rick James 03/11/2012 03:57PM


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.