Re: Retrieve the values from the table of its max date

2012-11-30 Thread hsv
 2012/11/29 11:46 +0530, Trimurthy 
i have a table which contains the columns 
date,sname,age,item,quantity,units.my question is i want to retrieve all 
the values from the table where date=maxdate group by sname how can i get 
those values.

A question, I suspect, found in all SQL courses


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql



RE: Retrieve the values from the table of its max date

2012-11-30 Thread Rick James
and answered many times on forums.mysql.com

 -Original Message-
 From: h...@tbbs.net [mailto:h...@tbbs.net]
 Sent: Thursday, November 29, 2012 5:40 PM
 To: mysql@lists.mysql.com
 Subject: Re: Retrieve the values from the table of its max date
 
  2012/11/29 11:46 +0530, Trimurthy 
 i have a table which contains the columns
 date,sname,age,item,quantity,units.my question is i want to retrieve
 all the values from the table where date=maxdate group by sname how can
 i get those values.
 
 A question, I suspect, found in all SQL courses
 
 
 --
 MySQL General Mailing List
 For list archives: http://lists.mysql.com/mysql
 To unsubscribe:http://lists.mysql.com/mysql


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql



Re: Retrieve the values from the table of its max date

2012-11-30 Thread walter harms
perhaps you are looking for something like

select entry,timestamp from table A where A.timestamp=(select max(B.timestamp) 
from table B where a.entry=b.entry);

also this oage may be helpful:
http://www.artfulsoftware.com/infotree/queries.php

re,
 wh


Am 30.11.2012 02:39, schrieb h...@tbbs.net:
 2012/11/29 11:46 +0530, Trimurthy 
 i have a table which contains the columns 
 date,sname,age,item,quantity,units.my question is i want to retrieve all 
 the values from the table where date=maxdate group by sname how can i get 
 those values.
 
 A question, I suspect, found in all SQL courses
 
 

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql