You could normalize your database and have all the common fields in one table "item".
Only store the type specific data in the separate 'demos', 'movies', and 'patches'
tables.
If you can't change your schema at this point, you can select the newest 20 items from
each table into a temporary table and then select the (global) newest 20 from the
temporary table.
At 01:46 PM 11/20/00 +1000, Rob Keniger wrote:
>Hi,
>
>I have a database for a client that stores various types of items in
>different tables, such as "demos", "movies", "patches" etc. Each of these
>tables has several common fields: id (pk), datecreated and itemid (fk).
>ItemID refers to another single table.
>
>I need to somehow join these tables to return a list of the newest 20 items
>added in the last 24 hours. That is, the newest twenty items overall across
>the tables, not the latest 20 in each table. Is there a way to do this with
>a single query?
>
>Thanks for any help.
>
>--
>
>Rob Keniger
>
>big bang solutions
>
><mailto:[EMAIL PROTECTED]>
><http://www.bigbang.net.au>
>
>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>Structure your ColdFusion code with Fusebox. Get the official book at
>http://www.fusionauthority.com/bkinfo.cfm
>
>Archives: http://www.mail-archive.com/[email protected]/
>Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
---------------------------------------------------------------------------
Peter Theobald, Chief Technology Officer
LiquidStreaming http://www.liquidstreaming.com
[EMAIL PROTECTED]
Phone 1.212.545.1232 x204 Fax 1.212.545.0938
To put this contact information into your Palm device, click here:
http://www.coola.com/cgi-bin/addinfo.cgi?pid=15803&rid=972879910&type=A
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists