473,569 Members | 2,813 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Having problem getting group by to work with order by

Hi All,

Trying to get a simple query going using group by and order by

I need to retrieve the latest record ordered by datetimestamp desc but
grouped by my nodeID column...

my data is thus;

7000802818, 2005-10-10 17:13:43
4, 2005-10-10 17:13:44
4, 2005-10-10 17:13:45
5, 2005-10-10 17:13:4

the first column being the nodeID, the second being the datetimestamp.. .
I cant seem to get the bleeder to work :(

Can anyone offer any assistance ?

THanks
Oct 19 '05 #1
1 1526
Think I solved it... so for the benefit of any others this is my
solution to the problem i had below..

select t1.serialno, t1.NodeID, t1.datetimestam p, t1.latitude,t1. longitude
from trackinglogs t1, trackinglogs t2
where t1.serialno = t2.serialno
group by t1.nodeid desc
having MAX(t1.datetime stamp) = MAX(t2.datetime stamp);

Dave Brown wrote:
Hi All,

Trying to get a simple query going using group by and order by

I need to retrieve the latest record ordered by datetimestamp desc but
grouped by my nodeID column...

my data is thus;

7000802818, 2005-10-10 17:13:43
4, 2005-10-10 17:13:44
4, 2005-10-10 17:13:45
5, 2005-10-10 17:13:4

the first column being the nodeID, the second being the datetimestamp.. .
I cant seem to get the bleeder to work :(

Can anyone offer any assistance ?

THanks

Oct 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
14153
by: Mike | last post by:
I am sure that I am making a simple boneheaded mistake and I would appreciate your help in spotting in. I have just installed apache_2.0.53-win32-x86-no_ssl.exe php-5.0.3-Win32.zip Smarty-2.6.7.tar.gz on a system running WindowsXP SP2. Apache and PHP tested out fine. After adding Smarty, I ran the following http://localhost/testphp.php
1
354
by: malcolm | last post by:
Hello, We have a small team building a project that involves some 30 or so c# assembly dlls. It is a client server application with 1 exe as the starting point. The dlls and exe are sharing an assemblyinfo file that has a strong name and version assiciated with it. We are having problems in the way we have been developing. We have made two...
2
1866
by: news | last post by:
This is a tough question to ask. I need to pull up a report of all the orders in our e-commerce site, that has more than one item attributed to it. orders.ordernum, orderitems.itemnumber orderitems.ordernum is shared with the same field in the orders table. In PHP I could just do a querey of all ordernumbers and within the WHILE do a...
3
8031
by: Louis | last post by:
Is there a switch or a setting in Access so that a group by query doesn't return a field name SumOf(original field name)? Especially when you chain multiple queries together you'd get SumOfSumOfSumOf.... Anyone know? TIA.
5
7210
by: alanspamenglefield | last post by:
Hello group, I have an SQL statement which pulls data from a table as follows: " SELECT tblSites.sites_siteno, " & _ " tblSites.sites_sitename, " & _ " Sum(tblStockResults.stkr_result) AS SumOfstkr_result, " & _ " Sum(tblStockResults.stkr_takings) AS SumOfstkr_takings, " & _
9
1733
by: chadlupkes | last post by:
I'm getting NULLs where there shouldn't be. Any help is appreciated. Here are the tables: precinct Field Type Null Key Default Extra id smallint(6) PRI NULL auto_increment precinct_number int(11) 0 precinct_name varchar(20) MUL
1
3093
by: lawton | last post by:
Source: this is an access 2003 question My knowledge level: reading books, internet, and trial & error; no formal training I'm trying to get a running sum of what's filtered in a subform which is ultimately driven by the results of two combo boxes: 1st combo box on main form that filters desired results for 2d combo box on sub form Main...
7
2367
by: Daniel Lee | last post by:
SELECT TOP 25 * FROM new_ticket WHERE group_num NOT IN (SELECT TOP 75 no FROM new_ticket ORDER BY no DESC) ORDER BY group_num DESC I am using the above method to get pagination with PHP Script. It is running on MS SQL Server 2005 Express Edition. After long been trying, I haven't found a way to get them grouped.
1
2667
by: ced69 | last post by:
having trouble getting marquee to work get object required errors tring t <title>This Month at the Chamberlain Civic Center</title> <link href="styles.css" rel="stylesheet" type="text/css" /> <script src="Dunbarlab9.js" type="text/javascript"></script> <script type="text/javascript">
0
7703
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7618
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7926
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8138
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
6287
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5223
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
1
2117
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1228
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
946
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.