bruce wrote:
i have a tbl with the following...
foo date1
foo2 date2
etc...
how can i do a select to get the last or 1st row based on the
(latest/earliest) date?
SELECT * FROM tbl order by datecolumn DESC LIMIT 1;
SELECT * FROM tbl order by datecolumn ASC LIMIT 1;
can't seem to get it to work..
AM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: Re: date question..
bruce wrote:
i have a tbl with the following...
foo date1
foo2 date2
etc...
how can i do a select to get the last or 1st row based on the
(latest/earliest) date?
SELECT * FROM tbl order by datecolumn DESC LIMIT
/comments
regards,
-bruce
-Original Message-
From: gerald_clark [mailto:[EMAIL PROTECTED]
Sent: Friday, September 10, 2004 11:12 AM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: Re: date question..
bruce wrote:
i have a tbl with the following...
foo date1
foo2 date2
etc...
how can i
PROTECTED]
Subject: Re: date question..
The manual describes 3 solutions to this problem
http://dev.mysql.com/doc/mysql/en/example-Maximum-column-group-row.html.
Michael
bruce wrote:
the earlier suggestion didn't work, as it only returned a single value...
here's the entire issue i have
There are different ways to do accomplish this.
You can use either:
SELECT id, datecol, text FROM table WHERE YEAR(datecol) = 2004 AND
MONTH(datecol) =$mySelectedMonth;
or:
SELECT id, datecol, text FROM table WHERE LEFT(datecol,7) =
'2004-$mySelectedMonth';
As of formated date... use the
Ed,
Wednesday, May 29, 2002, 2:24:40 AM, you wrote:
EL I'm not sure how to phrase this. Please excuse the crudeness of my description.
EL I'm storing calendar data in a MySQL database and I'm wondering, is there a
EL way to specify a day, such as the 28th, and fourth Tuesday as search
EL