Re: [SQL] Help Retrieving Latest Record

2001-02-16 Thread Jie Liang
Subquery will do: select * from basket where Date in (select max(Date) from basket); Jie LIANG St. Bernard Software Internet Products Inc. 10350 Science Center Drive Suite 100, San Diego, CA 92121 Office:(858)320-4873 [EMAIL PROTECTED] www.stbernard.com www.ipinc.com On Fri, 16 Feb 2001, St

Re: [SQL] Help Retrieving Latest Record

2001-02-16 Thread Tom Lane
Steve Meynell <[EMAIL PROTECTED]> writes: > select * from basket where max(date) and fruit='Apples'; > I know this doesn't work but I need something like it. Perhaps select * from basket where fruit='Apples' order by date desc limit 1; The limit clause is

Re: [SQL] Help Retrieving Latest Record

2001-02-16 Thread Michael Fork
SELECT * FROM basket ORDER BY date desc LIMIT 1; and SELECT * FROM basket WHERE fruit = 'apple' ORDER BY date desc LIMIT 1; Michael Fork - CCNA - MCP - A+ Network Support - Toledo Internet Access - Toledo Ohio On Fri, 16 Feb 2001, Steve Meynell wrote: > Hi, I am not sure if this went through t

Re: [SQL] Help Retrieving Latest Record

2001-02-16 Thread Roberto Mello
On Fri, Feb 16, 2001 at 09:41:09AM -0500, Steve Meynell wrote: > > I know this doesn't work but I need something like it. > or something like > > select * from basket where max(date) and fruit='Apples'; > This would yield me: > 15Apples July 20, 1999

Re: [SQL] Help Retrieving Latest Record

2001-02-16 Thread Dorin Grunberg
It would be something like: select * from basket where Date=(SELECT max(Date) from basket); At 09:41 AM 2/16/2001 -0500, Steve Meynell wrote: >Hi, I am not sure if this went through the first time so here it is again. > > >Ok what I am trying to do is select out of the database the latest rec

[SQL] Help Retrieving Latest Record

2001-02-16 Thread Steve Meynell
Hi,  I am not sure if this went through the first time so here it is again.   Ok what I am trying to do is select out of the database the latest record meeting a certain criteria. Example: Number |    Fruit | Date 15    Apples  July