Can you combine the queries?

Take the following example, given that there is a table post and there is a
table sprite. The post table contains several fields including a SPRITEID
field whos value corresponds directly the unique identifier of the same name
(SPRITEID) in the sprite table. The sprite table also contains a SPRITENAME
field that corresponds to the relative path of an image file.

    Select post.POSTID, post.SPRITEID, sprite.SPRITENAME, sprite.SPRITEID
from  post, sprite where post.SPRITEID = sprite.SPRITEID order by
sprite.SPRITENAME desc;

    I have this table here and these are the first few results:

'post.POSTID',' post.SPRITEID', 'sprite.SPRITENAME',
'sprite.SPRITEID'
'245',                 '21',                     '"..\..\graphical
dump\esd\wizardjames.gif"',    '21'
'252',                 '21',                     '"..\..\graphical
dump\esd\wizardjames.gif"',    '21'
'188',                 '13',                     '"..\..\graphical
dump\esd\trevor.gif"',             '13'
'216',                 '13',                     '"..\..\graphical
dump\esd\trevor.gif"',             '13'
'220',                 '13',                     '"..\..\graphical
dump\esd\trevor.gif"',             '13'
'228',                 '13',                     '"..\..\graphical
dump\esd\trevor.gif"',             '13'
'232',                 '13',                     '"..\..\graphical
dump\esd\trevor.gif"',             '13'
'233',                 '13',                     '"..\..\graphical
dump\esd\trevor.gif"',             '13'
'238',                 '13',                     '"..\..\graphical
dump\esd\trevor.gif"',             '13'
'242',                 '13',                     '"..\..\graphical
dump\esd\trevor.gif"',             '13'
'243',                 '13',                     '"..\..\graphical
dump\esd\trevor.gif"',             '13'
'248',                 '13',                     '"..\..\graphical
dump\esd\trevor.gif"',             '13'
'183',                 '10',                     '"..\..\graphical
dump\esd\stew.gif"',                '10'
'202',                 '10',                     '"..\..\graphical
dump\esd\stew.gif"',                '10'
'208',                 '10',                     '"..\..\graphical
dump\esd\stew.gif"',                '10'
'213',                 '10',                     '"..\..\graphical
dump\esd\stew.gif"',                '10'

    If you really want, look at the attatched txt file to see the full
results.

    This is from a silly news poster/CMS type thing I wrote called ESDNews

    I hope that helps you to work it out, if I'm understanding the question
correctly.

    Joe Parish


"R.G. Vervoort" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> it are different table and the first table does not contain names, onlu
the
> id form names.
>
> Ordering ASC woll not work because it is not in the first query
>
> thank for thinking with me anyway
> "Dennis Biletsky" <[EMAIL PROTECTED]> schreef in bericht
> news:[EMAIL PROTECTED]
> >
> > "R.G. Vervoort" <[EMAIL PROTECTED]> сообщил/сообщила в
новостях
> > следующее: news:[EMAIL PROTECTED]
> > >
> > >
> > >
> > >
> > > Does anyone have a suggestion how I can order a list with names in a
> > > secondary select string.
> > >
> > >
> > >
> > > The first string selects a number of locations where people work
> > >
> > >
> > >
> > > From this string I get several id's form people (in the location table
> > there
> > > are no names but id's form the people table) that work on those
> locations
> > >
> > >
> > >
> > > No I make another select to get the name form the people table using
the
> > id
> > > I got before.
> > >
> > >
> > >
> > > I would like to have the table ordered alphabetical by the name of the
> > > people
> > >
> > >
> > >
> > > Since the number op people is very long is will be to slow working the
> > other
> > > way around (first selecting people and then  looking for the location)
> > >
> > >
> > >
> > > Example:
> > >
> > >
> > >
> > > Location 1            Name A
> > >
> > >                         Name B
> > >
> > >                         Name C
> > >
> > > Location 3            Name D
> > >
> > >                         Name E
> > >
> > > Location 5            Name F
> > >
> > > Location 2            Name G
> > >
> > > Location 9            Name H
> > >
> > > Location 7            Name I
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > ORDER BY name ASC
> >
> >
>
>

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

Reply via email to