Hi,
On Mon, Apr 14, 2008 at 1:54 PM, Jamie Madill [EMAIL PROTECTED] wrote:
Hello,
Basically I want to know if this is a good query for indexing.
I have the following query:
select
count(1) as count
from
session
where
last = DATE_SUB(NOW(), INTERVAL :from SECOND)
Is it
Hello,
Basically I want to know if this is a good query for indexing.
I have the following query:
select
count(1) as count
from
session
where
last = DATE_SUB(NOW(), INTERVAL :from SECOND)
Is it safe to assume that the expression calling the function DATE_SUB
is evaluated just once to a
It's late and I just gave up reading the manual. Can someone please
tell me the easiest way to do a query that will return all rows with a
time stamp that is X number of seconds older than the current time?
Something like this.
SELECT * FROM t
WHERE TimeCol (now() - 60*60*24*3)
Yes I
From: Chris W Sent: 07 July 2006 09:23
It's late and I just gave up reading the manual. Can someone please
tell me the easiest way to do a query that will return all
rows with a
time stamp that is X number of seconds older than the current time?
Something like this.
SELECT *
Try this:
SELECT * FROM t
where TimeCol date_sub( now(), INTERVAL x SECOND )
Dan
On 7/7/06, Chris W [EMAIL PROTECTED] wrote:
It's late and I just gave up reading the manual. Can someone please
tell me the easiest way to do a query that will return all rows with a
time stamp that is X
: Chris W [EMAIL PROTECTED]
To: mysql@lists.mysql.com
Sent: Friday, July 07, 2006 4:23 AM
Subject: Date functions
It's late and I just gave up reading the manual. Can someone please
tell me the easiest way to do a query that will return all rows with a
time stamp that is X number of seconds older
Addison, Mark wrote:
From: Chris W Sent: 07 July 2006 09:23
It's late and I just gave up reading the manual. Can someone please
tell me the easiest way to do a query that will return all
rows with a
time stamp that is X number of seconds older than the current time?
Something like
Yesterday I was analyzing the behavior of the query optimizer, and I stumbled
into a most curious case.
I created two functions returning the extremes of a date range, and I wanted to
see how many times those functions were
called when used in a WHERE clause So I added log tracing instructions
In the last episode (Mar 01), Giuseppe Maxia said:
Yesterday I was analyzing the behavior of the query optimizer, and I
stumbled into a most curious case. I created two functions returning
the extremes of a date range, and I wanted to see how many times
those functions were called when used in
hi...
i've got a question/problem that i can't seem to figure out. it should be
simple/straightforward.
i'm creating a test tbl
id int
t1 timestamp
when i do a 'select * from tbl' i get what looks like a default date/time
format in the timestamp column.
i do a, (from mysql)
'insert into tbl
bruce wrote:
hi...
i've got a question/problem that i can't seem to figure out. it should be
simple/straightforward.
i'm creating a test tbl
id int
t1 timestamp
when i do a 'select * from tbl' i get what looks like a default date/time
format in the timestamp column.
i do a, (from mysql)
I have a log table that records certain transactions on one of my sites.
I'm using a timestamp field to mark the date/time of each transaction.
I'm trying to run a query that will display the transactions by date
using the following SQL:
SELECT COUNT(log_id) AS total,
Clarence wrote:
I have a log table that records certain transactions on one of my sites.
I'm using a timestamp field to mark the date/time of each transaction.
I'm trying to run a query that will display the transactions by date
using the following SQL:
SELECT COUNT(log_id) AS total,
Shoot me now, please.
Thanks - I don't know how I missed that! Thanks - re-ran the query and
things seem to be a-ok!
On Wed, 23 Feb 2005 18:42:17 +0100, Roger Baklund [EMAIL PROTECTED] wrote:
Clarence wrote:
I have a log table that records certain transactions on one of my sites.
I'm using
Hello.
My question concerns a large data table that has a DATETIME column
called dt. Specifically, I am often having to do selects based on date
and time functions that look like this:
select * from my_table where hour(dt)= 0
or
select * from my_table where month(dt) = 6
What index should I
:
Fax to:
06/24/2004 04:49 Subject: Optimizing selects based on
date functions.
PM
chastang wrote:
select * from my_table where hour(dt)= 0
or
select * from my_table where month(dt) = 6
What index should I create to optimize selects on these sorts of queries?
An index isn't going to help you there unless you create separate
columns for hour and month. The columns will be
At 03:49 PM 6/24/2004, you wrote:
Hello.
My question concerns a large data table that has a DATETIME column called
dt. Specifically, I am often having to do selects based on date and time
functions that look like this:
select * from my_table where hour(dt)= 0
or
select * from my_table where
Hi all
i'm new to the SQL programming language and i was trying to play with a
date/time counter of sorts. I was trying to teach myself the various
date functions, but I feel like I've failed. I had a database with
birthdates in it, and I subtracted that from date in the Year()
function
Hi all
i'm new to the SQL programming language and i was trying to play with
a date/time counter of sorts. I was trying to teach myself the various
date functions, but I feel like I've failed. I had a database with
birthdates in it, and I subtracted that from date in the Year()
function
]
Sent: Sunday, February 16, 2003 11:11 PM
Subject: date functions
Hi all
i'm new to the SQL programming language and i was trying to play with
a date/time counter of sorts. I was trying to teach myself the various
date functions, but I feel like I've failed. I had a database
Melih,
Year(Date - BirthDate) - 1900
What you're looking for is in the manual. Check it out:
http://www.mysql.com/doc/en/Date_calculations.html
Have fun! :)
Regards,
--
Stefan Hinz [EMAIL PROTECTED]
iConnect GmbH http://iConnect.de
Heesestr. 6, 12169 Berlin (Germany)
Telefon: +49 30
At 17:24 -0500 2/16/03, Melih Onvural wrote:
Hi all
i'm new to the SQL programming language and i was trying to play
with a date/time counter of sorts. I was trying to teach myself the
various date functions, but I feel like I've failed. I had a
database with birthdates in it, and I
Hello,
I am having trouble with a particular problem. I am trying to find a formulate
query that calculates the no of weekdays and no of weekend day in any given
month. I already have a method of generating the number of days in a given
month but at that point I am at a loss.
Any ideas?
Keith,
At 21:51 2002-02-28, you wrote:
That has certain advantages, but it's a pain for the user if it's in
a application where you have to enter a lot of dates or fill out a
form repeatedly. For that sort of data entry, typing digits is far
preferable to selecting from a dropdown list.
Hi all,
I asked this question on the PHP-DB list but everyone was asleep (no
response).
= = = = = = =
I have a site where dates are being displayed and also entered by users. I
don't want to offend them by asking them to use the -mm-dd format or to
split the
At 14:02 + 2/28/02, George Pitcher wrote:
Hi all,
I asked this question on the PHP-DB list but everyone was asleep (no
response).
= = = = = = =
I have a site where dates are being displayed and also entered by users. I
don't want to offend them by asking them
Message-
From: Paul DuBois [mailto:[EMAIL PROTECTED]]
Sent: Thursday, February 28, 2002 3:58 PM
To: George Pitcher; [EMAIL PROTECTED]
Subject: Re: Mysql Date Functions - input
At 14:02 + 2/28/02, George Pitcher wrote:
Hi all,
I asked this question on the PHP-DB list but everyone was asleep
At 15:02 2002-02-28, you wrote:
Hi all,
I asked this question on the PHP-DB list but everyone was asleep (no
response).
= = = = = = =
I have a site where dates are being displayed and also entered by users. I
don't want to offend them by asking them to use the
On 28 Feb 2002, at 21:24, Marjolein Katsma wrote:
The easiest way to work around all the date formats of the world
for data input on a web page is to simply split the input into
three parts: year, month and day. Month and day can then be
dropdown lists (built-in -partial- validation!) and
I think while you've got the hood up, a better method of doing the
difference between two dates should be derived.
Unless I'm going about this all wrong, the only way to get the time
difference between two values currently is:
UNIX_TIMESTAMP(end_datetime) - UNIX_TIMESTAMP(start_datetime)
Hi,
I'm using MM JDBC driver version 2.0.4 to access a MySQL database
3.23.40 on Solaris 2.8.
When I do the following query SELECT NOW(), I always get String data
and not Date data when fetching the data.
Is it normal that Date functions returns a String? Is this a MySQL bug
Hi !!!
)-Original Message-
)From: Ghislain Gadbois [mailto:[EMAIL PROTECTED]]
)Sent: Wednesday, September 05, 2001 7:37 AM
)To: MySQL List (E-mail)
)Subject: Date functions returning Strings
)
)
)Hi,
)
)I'm using MM JDBC driver version 2.0.4 to access a MySQL database
)3.23.40
Description:
I use the MM JDBC driver version 2.0.4 to access my MySQL database from my
Java app. If I do SELECT NOW(), it returns a String object and not a Date object.
I tried to call different functions (e.g. SELECT DATE_ADD(NOW(), INTERVAL 0 SECOND))
in order to have a Date in my
I've ran into a wall with the MAX() function when used with
DATE_ADD(). I'm posting to the list in hopes that someone has an idea,
comments, or suggestions for me. This is the problem at hand:
Given:
SELECT
(TO_DAYS(MAX(DATE_ADD(T.StartDate, INTERVAL T.Duration Day
-
On Wednesday 04 April 2001 04:03, Max Hammond wrote:
I'll just add that if anyone wants a dump of the data causing this, drop
me a note at [EMAIL PROTECTED] and I'll mail it to you, it's about 2500
rows, and only that one field necessary to crash it.
Cheers,
Max
Fix:
---
I have a table with a date field, and would like to sort it
on month and day. What I would like to do is:
SELECT lastname,firstname,dob FROM table1 GROUP BY month(dob),day(dob)
(where dob is a column of type 'date')
but that doesn't work. I'm using MySQL 3.22.32. I saw one post about
On Mon, Feb 19, 2001 at 11:06:21AM -0800, [EMAIL PROTECTED] wrote:
I have a table with a date field, and would like to sort it
on month and day. What I would like to do is:
SELECT lastname,firstname,dob FROM table1 GROUP BY month(dob),day(dob)
(where dob is a column of type 'date')
38 matches
Mail list logo