•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the MS SQL section within the Web Development category of DaniWeb, a massive community of 391,944 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,872 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our MS SQL advertiser:
Views: 487 | Replies: 3 | Solved
![]() |
•
•
Join Date: Nov 2006
Location: Feltwell, UK
Posts: 31
Reputation:
Rep Power: 2
Solved Threads: 0
Is there a keyword in SQL that would allow you to select a value from a field in the previous row? I am looking for something that would give me the speed field value for the row before:
SELECT min(Parsed.Time), [Parsed.Number] FROM Parsed GROUP BY [Parsed.Rev Number]
Last edited by dmmckelv : 34 Days Ago at 3:58 am. Reason: more specific
•
•
Join Date: Apr 2008
Posts: 295
Reputation:
Rep Power: 1
Solved Threads: 41
Hello dmmckelv,
When Edgar Frank Codd invited relational databases his primary idea was to found it on
logic algebra and set theory. The rows of relational tables (aka relations) are sets. Therefore, there aren't duplicate rows nor any particular order of rows. From this point of view, "I am looking for something that would give me the speed field value for the row before" is rather irrelevant.
However, to put any meaningful signification on it, your table must already have a column
which allows such an ordering, for example date, timestamp or auto-increment numbers.
If you don't have such special column (or set of columns) within a table, it is impossible to determine the predecessor of a specific row because the today predecessor could be the successor row tomorrow (e.g. due to inserting and deleting rows in the meantime).
To cut a long story short, what's that special column of your table to get particularly ordered rows? You may also post the creating statement of your table.
-----
tesu
When Edgar Frank Codd invited relational databases his primary idea was to found it on
logic algebra and set theory. The rows of relational tables (aka relations) are sets. Therefore, there aren't duplicate rows nor any particular order of rows. From this point of view, "I am looking for something that would give me the speed field value for the row before" is rather irrelevant.
However, to put any meaningful signification on it, your table must already have a column
which allows such an ordering, for example date, timestamp or auto-increment numbers.
If you don't have such special column (or set of columns) within a table, it is impossible to determine the predecessor of a specific row because the today predecessor could be the successor row tomorrow (e.g. due to inserting and deleting rows in the meantime).
To cut a long story short, what's that special column of your table to get particularly ordered rows? You may also post the creating statement of your table.
-----
tesu
Information is moving—you know, nightly news is one way, of course, but it's also moving through the blogosphere and through the Internets. I promise you I will listen to what has been said here, even though I wasn't here. Ann and I will carry out this equivocal message to the world. I'm the master of low expectations.
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
•
•
•
•
DaniWeb MS SQL Marketplace
Similar Threads
- How to include FLV videos in php (PHP)
- trying to make a survey for school yearbook, need help (PHP)
- Hi guys please clear my doubt. (ASP.NET)
- Need Help With Program (VB.NET)
- mysql_num_rows(): supplied argument is not a valid MySQL result resource (PHP)
- PHP/SQL query help (PHP)
Other Threads in the MS SQL Forum
- Previous Thread: Urgent Help needed.....
- Next Thread: [Help] Procedure


Linear Mode