Re: Problems with indexes on Date/DateTime fields

2006-01-05 Thread Jigal van Hemert
Javier Diaz wrote: EXPLAIN SELECT * FROM process_times WHERE date <= date_sub(now(), INTERVAL 2 day) date_idx,date_proc_idx (NULL) 10778561 EXPLAIN SELECT * FROM process_times WHERE date = date_sub(now(), INTERVAL 2 day) date_idx,date_proc_idx date_idx 1863456 My

RE: Problems with indexes on Date/DateTime fields

2006-01-05 Thread Javier Diaz
NDITIONS] Thanks a lot for your help Javier -Original Message- From: Jigal van Hemert [mailto:[EMAIL PROTECTED] Sent: 05 January 2006 14:39 To: Javier Diaz Cc: Aftab Khan; mysql@lists.mysql.com Subject: Re: Problems with indexes on Date/DateTime fields Javier Diaz wrote: > I would

Re: Problems with indexes on Date/DateTime fields

2006-01-05 Thread Jigal van Hemert
Javier Diaz wrote: I would like to know if there is any problem which cause Mysql to not use date indexes at least you use the "=" operator, because if that is the case we will need to re-visit a few queries If you do a select instead of a delete, will the index be used? (You can check th

RE: Problems with indexes on Date/DateTime fields

2006-01-05 Thread Javier Diaz
hat is the case we will need to re-visit a few queries Thx Javier -Original Message- From: Aftab Khan [mailto:[EMAIL PROTECTED] Sent: 05 January 2006 11:25 To: Javier Diaz Subject: RE: Problems with indexes on Date/DateTime fields I agree. Some time full table scan is faster than

RE: Problems with indexes on Date/DateTime fields

2006-01-05 Thread Javier Diaz
avier -Original Message- From: Aftab Khan [mailto:[EMAIL PROTECTED] Sent: 05 January 2006 11:03 To: Javier Diaz Subject: Re: Problems with indexes on Date/DateTime fields Is not the second quary doing a full table scan? The parser may find this better than using the Index. --- Javier

Problems with indexes on Date/DateTime fields

2006-01-05 Thread Javier Diaz
Hi all We are having a weird problem with some queries which are not using some indexes in date fields. Query-1 SELECT [field list] FROM tableX WHERE dateField = [any date expression or constant value] Query-2 SELECT [field list] FROM tableX WHERE dateField <= [any date expression or constant

Re: # Seconds between two datetime fields

2005-03-03 Thread Roger Baklund
Brian Erickson wrote: We have a table that has two datetime fields (start_time and end_time). We'd like to be able to calculate the number of seconds between these two fields in a query. However, a simple "end_time - start_time" does not yield a correct result. SELECT start

Re: # Seconds between two datetime fields

2005-03-03 Thread Patrick
PM Subject: # Seconds between two datetime fields > We have a table that has two datetime fields (start_time and > end_time). We'd like to be able to calculate the number of seconds > between these two fields in a query. However, a simple "end_time - > start_time" does n

# Seconds between two datetime fields

2005-03-03 Thread Brian Erickson
We have a table that has two datetime fields (start_time and end_time). We'd like to be able to calculate the number of seconds between these two fields in a query. However, a simple "end_time - start_time" does not yield a correct result. SELECT start_time, end_time, end_time -

re: subtraction on datetime fields

2002-12-11 Thread Egor Egorov
On Wednesday 11 December 2002 12:44, Tom Roos wrote: > i want to build a query in which i have 2 datetime fields which i subtract > from one another. what is the result set? is it in (milli)seconds, is it a > unix timestamp? > what type of convertion do i have to apply to report the d

Re: subtraction on datetime fields

2002-12-11 Thread Andy Bakun
On Wed, 2002-12-11 at 04:44, Tom Roos wrote: > hi > > i want to build a query in which i have 2 datetime fields which i subtract > from one another. what is the result set? is it in (milli)seconds, is it a > unix timestamp? what type of convertion do i have to apply to report th

subtraction on datetime fields

2002-12-11 Thread Tom Roos
hi i want to build a query in which i have 2 datetime fields which i subtract from one another. what is the result set? is it in (milli)seconds, is it a unix timestamp? what type of convertion do i have to apply to report the difference in minutes? tks tom

Re: DateTime Fields

2002-09-23 Thread b.ware
clarify exactly what you mean. show an example.. you question is confusing. cw --- shahana qureshi <[EMAIL PROTECTED]> wrote: > Please tell me how can I get the date and time > values > diffently in a single query from 'DateTime' field > and the difference of two D

DateTime Fields

2002-09-20 Thread shahana qureshi
Please tell me how can I get the date and time values diffently in a single query from 'DateTime' field and the difference of two DateTime fields in HH:MM:SS format. Thanks shahana __ Do you Yahoo!? New DSL Internet Access from SBC &am

Re: newby question about datetime fields

2001-11-02 Thread Tony
Try this: select * from my_table order by my_datetime ASC; select * from my_table order by my_datetime DESC; Cheers, T On Thursday 01 November 2001 06:15 am, brainheap wrote: > Hi ppl! > > I have a table with datetime type column in it. > > > when I make request "select * from

RE: newby question about datetime fields

2001-11-01 Thread Rick Emery
select * from my_table order by my_datetime DESC -Original Message- From: brainheap [mailto:[EMAIL PROTECTED]] Sent: Thursday, November 01, 2001 5:16 AM To: MySQL mailing list Subject: newby question about datetime fields Hi ppl! I have a table with datetime type column in it. when

RE: newby question about datetime fields

2001-11-01 Thread Carsten H. Pedersen
> Hi ppl! > > I have a table with datetime type column in it. > > > when I make request "select * from my_table order by my_datetime" > > I get the normal sort i.e. first the oldest dates but I want to get > reverse sort to have most recent dates to be the first. > > How can I do this? http:

newby question about datetime fields

2001-11-01 Thread brainheap
Hi ppl! I have a table with datetime type column in it. when I make request "select * from my_table order by my_datetime" I get the normal sort i.e. first the oldest dates but I want to get reverse sort to have most recent dates to be the first. How can I do this? Thanks for any help :0) Al

Re: MYSQL bug with if and datetime fields

2001-08-14 Thread Michael Widenius
Hi! >>>>> "Sinisa" == Sinisa Milivojevic <[EMAIL PROTECTED]> writes: Sinisa> Arturs Aboltins writes: >> From: [EMAIL PROTECTED] >> To: [EMAIL PROTECTED] >> Subject: MYSQL bug with if and datetime fields >> >> >Description: &

Re: MYSQL bug with if and datetime fields

2001-08-14 Thread Sinisa Milivojevic
Arturs Aboltins writes: > From: [EMAIL PROTECTED] > To: [EMAIL PROTECTED] > Subject: MYSQL bug with if and datetime fields > > >Description: > In queries where datetime field is in "WHERE" condition, the same > field > in "IF" sta

MYSQL bug with if and datetime fields

2001-08-14 Thread Arturs Aboltins
From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: MYSQL bug with if and datetime fields >Description: In queries where datetime field is in "WHERE" condition, the same field in "IF" statement causes incorrect query

Re: Difference of two datetime fields.

2001-02-18 Thread Rolf Hopkins
ect: Difference of two datetime fields. > Hello, > How could I obtain the difference of two datetime fields giving the result > in seconds, like the function datediff in MSsql ? > I tried date_sub but I had no success. > Ex: 2001-02-16 15:00:00 - 2001-02-16 14:00:00=3600 se

Difference of two datetime fields.

2001-02-16 Thread Laercio Brehmer
Hello, How could I obtain the difference of two datetime fields giving the result in seconds, like the function datediff in MSsql ? I tried date_sub but I had no success. Ex: 2001-02-16 15:00:00 - 2001-02-16 14:00:00=3600 seconds Thanks, Laercio Brehmer CIASC [EMAIL PROTECTED