Hi Tobias,

Would the UNION command help?
(otherwise we'd need to see the table definitions to comment)

Regards,
=dn


----- Original Message -----
From: "Tobias Kremer :: IT" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: 28 January 2002 12:34
Subject: Re: selecting over various tables


Hi,

Thanx dn. I know how to build joined selects but the problem is that those
two tables are not joinable. I don't have an entry in table 1 which
references to a field in table 2. I just want to create a list of
both tables ordered by date and limited to say 20 entries.

At 12:22 28.01.02 +0000, you wrote:
>Hi Tobias,
>
>Assume I have various tables which all have these three fields:
>
>userid, title, date_created
>
>Now I want to create a list containing entries
>of all tables ordered by date_created with a single select.
>
>Is this possible or do I have to make either various
>selects or create an extra table which stores just this
>information ?
>
>
>=Yes it can be done in a single statement, eg
>
>SELECT *
>   FROM userid, title, date_created
>   WHERE -join the tables together-
>   ORDER BY date_created
>
>=This is quite a large/involved topic. If you are not familiar with SQL
>and relational techniques then instead
>of attempting to read it in an email msg, it would be better to check out
>some of the introductory articles on
>the various PHP-support sites (start with the links at PHP.net); or
>getting hold of an introductory text book.
>
>=Establish the linkage/relationship between each pair of tables using a
>'join'.
>=Establish the sequence of the resultset by using the ORDER BY clause of a
>SELECT statement.
>=These are detailed in the online manual (which has a search facility).
>
>=Regards,
>=dn

urbia Grüße - best regards

Tobias Kremer
Webmaster / Software-Entwicklung

urbia.com AG
Hohe Str.115,  50667 Köln

tel:    +49 (0)221 - 2949 154
fax:    +49 (0)221 - 2949 599
e-mail: [EMAIL PROTECTED]

http://www.urbia.de - we are family
http://www.urbia.fr - votre espace famille
http://www.urbia.co.uk - the family site

"Linux is like a wigwam. No gates, no windows
but an apache inside"


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to