473,394 Members | 1,752 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

How to get the last row in from multiple groups of data?

167 100+
I am running windows xp, ms office 2000. I have an application that has data that looks like this:
Expand|Select|Wrap|Line Numbers
  1. FuelType  Year   State   (column names,all keys, so no dups allowed)
  2. Diesel    1999     NC
  3. Diesel    2000     NC
  4. Diesel    2001     NC
  5. Gas       1998     SC
  6. Gas       1999     SC
  7. Gas       2000     SC
What I am trying to do is to select the last row in the each set of keys, basically, I want one row for each FuelType, Year & State. So, for NC, I would get the row for Diesel 2001, for SC I would get Gas for 2000. Maybe I am over compliating this but I am trying to use the 'max' function and can not get the results I need. There are other columns of data on the record I will need once I can determine which is the last row for this grouping. Any guidance would be appreciated!!!!
Sep 5 '08 #1
1 1140
NeoPa
32,556 Expert Mod 16PB
This is possible. Unfortunately your example seems to contradict your explanation, so I'm not sure what you're after here (Is it max year for each FuelType / State combination? Or max FuelType / Year for each State as per your example explanations?).

Please clarify and then we can proceed.
Sep 5 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

11
by: Vani Murarka | last post by:
Hi Everyone, Does .NET offer any collection class which will give me objects last *accessed* such that I may build a least-recently-used cache that kills off objects that haven't been used for...
13
by: SimonC | last post by:
I would like to return data from the last 2 weeks of each given month in Javascript, but in 2 formats. So, the penultimate week (Monday to Sunday) and the last week (Monday to ??) I'm not...
18
by: jas | last post by:
Hi, I would like to start a new process and be able to read/write from/to it. I have tried things like... import subprocess as sp p = sp.Popen("cmd.exe", stdout=sp.PIPE)...
3
by: Epetruk | last post by:
Hi, I have a mySql question here on updates to multiple tables. Here's a simple schema to clarify things: Structure Table A
0
by: etamp | last post by:
Etamp.net, the fast rss-reader for RSS content including weblogs and news, the fast search engine for RSS content including weblogs and news, No software download, All OS' & Browsers, IE, Netscape,...
8
by: Jean | last post by:
Hello all, I have the following data, that was queried and sorted to columns PROBLEM_ID and then by STATUSDATE (ascending): STATUS_ID STATUSDATE PROBLEM_ID --------- ---------- ...
1
by: AndiSHFR | last post by:
Hi. How do i "bulk update" data rows on a dataset table from another one DataTable? i have a dataset ds1 with a table "Groups" and a table "newgroupdata" and i want to update the records in...
2
by: kinarism | last post by:
Sorry for posting on multiple groups with this, I am new to the groups and didnt know the possibility of "cross-posting" was possible. Anyway, my post in the "upgrade" group hasnt gotten any...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.