Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 140391
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T07:36:23+00:00 2026-05-11T07:36:23+00:00

I have an Informix database containing measured temperature values for quite a few different

  • 0

I have an Informix database containing measured temperature values for quite a few different locations. The measurements are taken every 15 min for all locations and then loaded with a timestamp into the same table. Table looks like this:

 locId    dtg               temp aaa      2009-02-25 10:00  15 bbb      2009-02-25 10:00  20 ccc      2009-02-25 10:00  24 aaa      2009-02-25 09:45  13 ccc      2009-02-25 09:45  16 bbb      2009-02-25 09:45  18 ddd      2009-02-25 09:45  12 aaa      2009-02-25 09:30  11 ccc      2009-02-25 09:30  14 bbb      2009-02-25 09:30  15 ddd      2009-02-25 09:30  10 

Now I would like a query that present me with the change in temperature between the two last measurements for all stations. And also, only the ones that has an updated measurement. For example in the table above, location ddd would not be included. So the result becomes:

 locId    change aaa      2 bbb      2 ccc      8 

I have tried alot but I can´t find any good solution. In reality it is about 700 locations that is asked from a web page so I think the query needs to be fairly efficient.

Would really appreciate some help!
//Jesper

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T07:36:23+00:00Added an answer on May 11, 2026 at 7:36 am
    set now = select max(dtg) from table; set then = select max(dtg) from table where dtg < now;  select locID, old.temp-new.temp from        table as old join       table as new        on old.locId = new.locID where       old.dtg = then and       new.dtg = now; 

    assumes that all times will be exact

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have Informix database with timestamp field defined as YEAR TO SECOND. When I
I have to connect my app to a customer's Informix 7.2 legacy database. From
I would like to transfer the whole Database i have in Informix to Oracle.
I have an Informix SQL query which returns a set of rows. It was
Question: Does Informix have a construct equivalent to Oracle's materialized view or is there
I have problem when I try insert some data to Informix TEXT column via
I have Informix Dynamic Server 11.50 and Informix Client SDK 3.5 installed on my
We are trying to duplicate one of our informix database on a test server,
In Informix I can run SQL statement that use other database: INSERT INTO other_db:mytable
We have an application using the IBM Informix driver. Whenever we try to open

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.