Re: SELECT FROM ALL TABLES

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I'm with John on both counts.  This relates very little to PHP and calls for
a join.  Check out the below article from DevShed for info on SQL joins.
http://www.devshed.com/Server_Side/MySQL/SQLJoins

Edward Dudlik
Becoming Digital
www.becomingdigital.com


----- Original Message -----
From: "CPT John W. Holmes" <holmes072000@charter.net>
To: "Bruce Levick" <bruce@vivamotion.com>; <php-db@lists.php.net>
Sent: Friday, 18 April 2003 10:01
Subject: Re:  SELECT FROM ALL TABLES


This is more of a straight SQL question rather than PHP. You don't show the
query you're trying to use, either. If you're using MySQL4, you could look
into UNION or joining all of the tables together, or using a temp table.

---John Holmes...

----- Original Message -----
From: "Bruce Levick" <bruce@vivamotion.com>
To: <php-db@lists.php.net>
Sent: Friday, April 18, 2003 9:52 AM
Subject:  SELECT FROM ALL TABLES


> Hi Guys,
> Am having a little trouble with selecting a certain piece of data from all
> tables and then displaying the results.
>
> I have 5 tables (Concepts, Illustrations, ID, Photos, Misc). All tables
have
> a column named (itemMonth). Which is simply a month of the year (any
month).
> I am trying to display the results of a SELECT query where itemMonth =
> 'April'. But can't for the life of me get the results from all the tables
to
> display from one SELECT query.
>
> So for example the display might look something like this.
>
> Here are all the new works from April (Concepts, Illustrations, ID,
Photos,
> Misc)
> Concepts 1
> Concepts 2
> Concepts 3
> Illustraion 1
> ID 1
> Photos 1
> Misc 1
> Misc 2
>
>
> There could be any number of results from either of the tables. Obviously
> only after results where itemMonth = 'April'.
>
> I have tried many combinations to get this to work. I don't think the
> solution is to produce a select query for each table, that seems a bit
code
> heavy.
>
> Sorry if I am missing something obvious....am a little tired.
>
> Bruce
>
>
>
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php





-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux