Dear group members,
I have a serious problem with an SQL query that has kept me busy for over a week.
Doing my compusory service at a non-profit environmental organisation I was asked to
experiment with SQL queries within the ArcView GIS program. My problem is quite simple
indeed and only refers to the SQL query:
There is a table with quite a lot of columns. But only two of them are really
important for my query: One field is a date field and the other one is a group name.
My aim is to create a query that only selects the item with the most recent date. That
is simple and can be handled by max(date). But only the most recent item from each
group shall be given as a result of my query. That's also fine. With the query
select groupname,max(date) from databasename Group By groupname
I got what I wanted and was happy. BUT: As soon as I told the database to read out
more fields it no longer worked to get the most recent item from the particular
groups. Instead there were many items having the same group which I wanted to supress
with max(date)
My query was in the form of "select groupname,field1,fieldn,max(date) from
databasename Group By groupname, field1,fieldn ...."
Has anyone an idea how to overcome this problem?
Thanks a lot in advance,
Fabian Groene
_______________________________________________________________________
1.000.000 DM gewinnen - kostenlos tippen - http://millionenklick.web.de
[EMAIL PROTECTED], 8MB Speicher, Verschluesselung - http://freemail.web.de
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php