Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

query help

Status
Not open for further replies.

mikedaruke

Technical User
Mar 14, 2005
199
US
I have one big table like this

ID, name, neighborhood, street, date, moreinfo, etc

I want do a

select name, neighborhood, street, max(date)
from table group by name, neighborhood, street

as that gives me exactly what i need.

Then somehow I need to get the ID field to end up getting other information in the table. But the ID field is a key and is unique per row. Once I get the max date I then need the other info, but don't know how to get it.

Any help?
 
Mike said:
I want do a

select name, neighborhood, street, max(date)
from table group by name, neighborhood, street

as that gives me exactly what i need.
Apparently, that is not "exactly what you need"...since you are asking for...
Mike said:
somehow I need to get the ID field to end up getting other information in the table.
Can you please explain more about "what" and "how" you want the data...Perhaps a sample set of output despite your not knowing the code of how to produce that desired output?

[santa]Mufasa
(aka Dave of Sandy, Utah, USA)
[I provide low-cost, remote Database Administration services: www.dasages.com]
 
select * from table
where (name, neighborhood, street, date)
=
(
select name, neighborhood, street, max(date)
from table group by name, neighborhood, street
)


should be close to your requirements



In order to understand recursion, you must first understand recursion.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top