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

2006-06-20 Thread Dan Buettner
TED]> To: 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 into: A table has like 400,000 rows, with a primary key index id. I use this query: SELECT * FROM tab

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

2006-06-20 Thread Brent Baisley
he query to see what mysql is going to do. - Original Message - From: "Peter Van Dijck" <[EMAIL PROTECTED]> To: 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

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 i

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

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]

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

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

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-07-29 Thread Benjamin Pflugmann
sult = 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 BY date DESC"); > > > > Everything works fine, but the ORDER BY bit sorts all date

Re: order by date

2002-07-29 Thread Francisco Reinaldo
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 BY > date DESC"

Re: order by date

2002-07-29 Thread Quinten Steenhuis
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 be a regularly appearing problem, which is why

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

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 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: 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, "; >^^^

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 da

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-

Re: Re: Order by date

2002-05-07 Thread Victoria Reznichenko
ER BY clause is used string 'date'. That is why you get "wrong" sorting. Use another alias for your date column, it should help you, i.e.: $qry="SELECT id, module, week, "; $qry.="DATE_FORMAT(date, \"%d %m %Y\") as mydate, "; [s

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 2

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

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

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:

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

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 attem

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

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 d

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 incorr