Query question: select * from table where id in (1,2,3) order by date uses FILESORT

2006-06-20 Thread Peter Van Dijck
Hi all, this is a problem I'm running into: A table has like 400,000 rows, with a primary key index id. I use this query: SELECT * FROM table WHERE id IN (58, 25, 75, ...) ORDER BY post_date DESC LIMIT 0, 40 The problem is, it uses the index id and then a FILESORT. Questions: 1) Am I correct

Re: Query question: select * from table where id in (1,2,3) order by date uses FILESORT

2006-06-20 Thread Brent Baisley
what mysql is going to do. - Original Message - From: Peter Van Dijck [EMAIL PROTECTED] To: mysql@lists.mysql.com Sent: Tuesday, June 20, 2006 3:08 AM Subject: Query question: select * from table where id in (1,2,3) order by date uses FILESORT Hi all, this is a problem I'm running

Re: Query question: select * from table where id in (1,2,3) order by date uses FILESORT

2006-06-20 Thread Dan Buettner
, 2006 3:08 AM Subject: Query question: select * from table where id in (1,2,3) order by date uses FILESORT Hi all, this is a problem I'm running into: A table has like 400,000 rows, with a primary key index id. I use this query: SELECT * FROM table WHERE id IN (58, 25, 75, ...) ORDER

ORDER by date: reverse order

2004-11-05 Thread Jerry Swanson
I want to sort by date but the last date appears first. How to write such query? TH -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]

RE: ORDER by date: reverse order

2004-11-05 Thread Jay Blanchard
[snip] I want to sort by date but the last date appears first. How to write such query? [/snip] RTFM ORDER BY theDate DESC -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]

Re: ORDER by date: reverse order

2004-11-05 Thread DeRyl
write: order by date desc DeRyl - Original Message - From: Jerry Swanson [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, November 05, 2004 8:00 PM Subject: ORDER by date: reverse order I want to sort by date but the last date appears first. How to write such query? TH

Order by date

2002-09-03 Thread Xavier NOPRE
Hi, I have a query from tables that give me records with two date date1 and date2. How can I order the records by the most recent date (between the two date) for each records ? Example: Data: IDdescriptiondate1date2 1 aaa09/03/02 09/05/02 2

Re: Order by date

2002-09-03 Thread Mikhail Entaltsev
Xavier, select ID, description, if (ifnull(date1, 20201231) ifnull(date2, 20201231), ifnull(date1, 20201231), ifnull(date2, 20201231)) as date from MyTable order by date I didn't test it, but it should work. Any questions? don't hesitate to ask. Best regards, Mikhail. - Original

order by date

2002-07-29 Thread julian haffegee
This must be a regularly appearing problem, which is why i'm surprised I can't find a webpage on it.. I have $result = mysql_query(SELECT title, url, description, author, date_format(date,'%D %M %Y') AS date FROM documents_tbl, url_tbl WHERE documents_tbl.title_id = url_tbl.url_id ORDER

Re: order by date

2002-07-29 Thread Quinten Steenhuis
. On Mon, 29 Jul 2002, julian haffegee wrote: Date: Mon, 29 Jul 2002 17:59:00 +0100 From: julian haffegee [EMAIL PROTECTED] To: MySQL General List [EMAIL PROTECTED] Subject: order by date This must be a regularly appearing problem, which is why i'm surprised I can't find a webpage on it.. I have

Re: order by date

2002-07-29 Thread Francisco Reinaldo
title, url, description, author, date_format(date,'%D %M %Y') AS date FROM documents_tbl, url_tbl WHERE documents_tbl.title_id = url_tbl.url_id ORDER BY date DESC); Everything works fine, but the ORDER BY bit sorts all dates as 9th, 8th 7th etc rather than 31st, 30th and so on. can

Re: order by date

2002-07-29 Thread Benjamin Pflugmann
a string 20020729. I don't see how this could be sorted incorrectly, but check your types. On Mon, 29 Jul 2002, julian haffegee wrote: Date: Mon, 29 Jul 2002 17:59:00 +0100 From: julian haffegee [EMAIL PROTECTED] To: MySQL General List [EMAIL PROTECTED] Subject: order by date This must

ORDER BY date DESC

2002-06-12 Thread Son Nguyen
mysql desc albums; +-+-+--+-+++ | Field | Type| Null | Key | Default| Extra | +-+-+--+-+++ | album_ID| int(11) | | PRI | NULL | auto_increment | |

Re: ORDER BY date DESC

2002-06-12 Thread Son Nguyen
Never mind ... I made a mistake in the SQL statement !!! :-) Son Nguyen --- Son Nguyen [EMAIL PROTECTED] wrote: mysql desc albums; +-+-+--+-+++ | Field | Type| Null | Key | Default| Extra |

Order by date

2002-05-07 Thread Nick Wilson
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi all I've been searching for a solution to the following: Is there an easy way to order by date ( - MM - DD), at the moment my results are coming back with the *day* ordered but not the whole date like this: 02 02 2002 03 03 2005 18 02 2003

Re: Order by date

2002-05-07 Thread Victoria Reznichenko
Nick, Tuesday, May 07, 2002, 12:06:31 PM, you wrote: NW I've been searching for a solution to the following: NW Is there an easy way to order by date ( - MM - DD), at the moment my NW results are coming back with the *day* ordered but not the whole date NW like this: NW 02 02 2002 NW 03 03

Re: Order by date

2002-05-07 Thread Nick Wilson
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 * and then Victoria Reznichenko declared NW I've been searching for a solution to the following: NW Is there an easy way to order by date ( - MM - DD), at the moment my NW results are coming back with the *day* ordered but not the whole

Re: Order by date

2002-05-07 Thread Tahir Ata Barry
~~~ 5/7/2002 6:01:09 PM, Nick Wilson [EMAIL PROTECTED] wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 * and then Victoria Reznichenko declared NW I've been searching for a solution to the following: NW Is there an easy way to order by date ( - MM - DD), at the moment

RE: Order by date

2002-05-07 Thread Jay Blanchard
[snip] NW Is there an easy way to order by date ( - MM - DD), at the moment my NW results are coming back with the *day* ordered but not the whole date NW like this: NW 02 02 2002 NW 03 03 2005 NW 18 02 2003 NW See what I mean? [/snip] If the date is in the format above you can

Re: Re: Order by date

2002-05-07 Thread Victoria Reznichenko
, \%d %m %Y\) as mydate, ; [skip] $qry.=ORDER BY date ASC; NW $qry.=ektione, title, teacher_id ; NW $qry.=FROM $this-table ; NW $qry.=WHERE module = '$module' ; NW $qry.=ORDER BY date ASC; NW Thanks very much for the help! -- For technical

Re: Order by date

2002-05-07 Thread Nick Wilson
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 * and then Jay Blanchard declared If the date is in the format above you can select a substring +++ | field1 | rDate | +++ | 1 | 2002-03-01 | | 2 | 2002-03-03 | | 3 | 2002-03-05

Re: Order by date

2002-05-07 Thread James Fidell
Quoting Nick Wilson ([EMAIL PROTECTED]): -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 * and then Victoria Reznichenko declared NW I've been searching for a solution to the following: NW Is there an easy way to order by date ( - MM - DD), at the moment my NW results

Re: Re: Order by date

2002-05-07 Thread Nick Wilson
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 * and then Victoria Reznichenko declared NW and here is my select: NW $qry=SELECT id, module, week, ; NW $qry.=DATE_FORMAT(date, \%d %m %Y\) as date, ; The

order by date error!!!

2002-02-27 Thread Wakan
Hi, I've noticed this problem, even if I don't know if it's really a mysql problem: if I store a date in standard format, in a date field, all kinds of ordering are OK. But if I change the output format with: DATE_FORMAT(data,'%d-%m-%Y'), the order by clause attempt to order the new format

RE: order by date error!!!

2002-02-27 Thread Andreas Frøsting
But if I change the output format with: DATE_FORMAT(data,'%d-%m-%Y'), the order by clause attempt to order the new format incorrectly, because I've an output like this: 12-2-2002, 12-3-2002, 12-4-2002, and 13-2-2002!!! I normally do this: SELECT DATE_FORMAT(datefield,'%d-%m-%Y') as

Re: order by date error!!!

2002-02-27 Thread Keith C. Ivey
Wakan [EMAIL PROTECTED] wrote: But if I change the output format with: DATE_FORMAT(data,'%d-%m-%Y'), the order by clause attempt to order the new format incorrectly, because I've an output like this: 12-2-2002, 12-3-2002, 12-4-2002, and 13-2-2002!!! What can you say about this? Can you give

Re: order by date error!!!

2002-02-27 Thread Joseph Bueno
Hi, Wakan wrote : Hi, I've noticed this problem, even if I don't know if it's really a mysql problem: if I store a date in standard format, in a date field, all kinds of ordering are OK. But if I change the output format with: DATE_FORMAT(data,'%d-%m-%Y'), the order by clause attempt to