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

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 | | sxmns |

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 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

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() function

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

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 |

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

RE: Order by list?

2002-03-12 Thread John Lodge
, 2002 4:00 AM To: '[EMAIL PROTECTED]' Subject: Order by list? Hi all, I'm executing the follow very simple type of query to select entries from a list: select entryid, entryinfo from mytable where entryid in ('id7', 'id4', 'id2', 'id5') and, even though I don't specify any sorting order

Order by list?

2002-03-11 Thread George Marnellos
Hi all, I'm executing the follow very simple type of query to select entries from a list: select entryid, entryinfo from mytable where entryid in ('id7', 'id4', 'id2', 'id5') and, even though I don't specify any sorting order, MySQL sorts alphabetically by the field entryid (which happens to

Re: Order by list?

2002-03-11 Thread Paul DuBois
At 20:00 -0800 3/11/02, George Marnellos wrote: Hi all, I'm executing the follow very simple type of query to select entries from a list: select entryid, entryinfo from mytable where entryid in ('id7', 'id4', 'id2', 'id5') and, even though I don't specify any sorting order, MySQL sorts