Re: Sort results by order in list

2007-10-30 Thread Peter Brawley
PaPa, It comes from external source together with Relevance value (float), Then you need to ORDER BY that func. PB - Papalagi Pakeha wrote: Hi, It comes from external source together with Relevance value (float), where the first ID has highest relevance and subsequent IDs are in decre

Re: Sort results by order in list

2007-10-30 Thread Papalagi Pakeha
On 10/30/07, Johan Höök <[EMAIL PROTECTED]> wrote: > Hi, > what you probably want is > SELECT id, start_date FROM iddt WHERE id IN > ('109k7','s3x6','sxmns','wt57') > ORDER BY FIELD(id,'109k7','s3x6','sxmns','wt57') That's exactly it! Thanks a lot :-) Just for the record, here's the FIELD() funct

Re: Sort results by order in list

2007-10-30 Thread Johan Höök
Hi, what you probably want is SELECT id, start_date FROM iddt WHERE id IN ('109k7','s3x6','sxmns','wt57') ORDER BY FIELD(id,'109k7','s3x6','sxmns','wt57') /Johan Papalagi Pakeha skrev: On 10/30/07, Sebastian Mendel <[EMAIL PROTECTED]> wrote: Papalagi Pakeha schrieb: Hello, I have a query lik

Re: Sort results by order in list

2007-10-30 Thread Papalagi Pakeha
On 10/30/07, Sebastian Mendel <[EMAIL PROTECTED]> wrote: > Papalagi Pakeha schrieb: > > Hello, > > > > I have a query like: > > SELECT id, start_date FROM iddt WHERE id IN ('109k7','s3x6','sxmns','wt57'); > > which gives me: > > +---+-+ > > | id| start_date | >

Re: Sort results by order in list

2007-10-30 Thread Sebastian Mendel
Papalagi Pakeha schrieb: > Hello, > > I have a query like: > SELECT id, start_date FROM iddt WHERE id IN ('109k7','s3x6','sxmns','wt57'); > which gives me: > +---+-+ > | id| start_date | > +---+-+ > | 109k7 | 2007-10-07 12:06:58 | > | sx

Re: Sort results by order in list

2007-10-30 Thread Papalagi Pakeha
Hi, It comes from external source together with Relevance value (float), where the first ID has highest relevance and subsequent IDs are in decreasing order. For example: 109k7 1.79 s3x6 1.34 sxmns 1.21 wt57 0.93 I could use these numbers in the query as well if it helps. PaPa On 10

Re: Sort results by order in list

2007-10-29 Thread Peter Brawley
I.e. the ideal output would be: +---+-+ | id| start_date | +---+-+ | 109k7 | 2007-10-07 12:06:58 | | s3x6 | 2007-10-07 08:58:20 | | wt57 | 2007-10-07 15:57:37 | | sxmns | 2007-10-06 02:17:30 | +---+-+ What rul

Sort results by order in list

2007-10-29 Thread Papalagi Pakeha
Hello, I have a query like: SELECT id, start_date FROM iddt WHERE id IN ('109k7','s3x6','sxmns','wt57'); which gives me: +---+-+ | id| start_date | +---+-+ | 109k7 | 2007-10-07 12:06:58 | | sxmns | 2007-10-06 02:17:30 | | wt57 | 2007-10