473,480 Members | 1,492 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Performing calculation using two rows from the same table

5 New Member
I have a table that contains file name, file seq num, etc. I would like to compare the two rows to make sure the file seq num is being incremented by one or more. If it is incremented >1 then I l know that there is a file missing.
Apr 5 '07 #1
2 3376
iburyak
1,017 Recognized Expert Top Contributor
Try this:

[PHP]select sequence
from table a
where not exists(select sequence from table where sequence = a.sequence + 1)[/PHP]

Good Luck.
Apr 6 '07 #2
mamin
5 New Member
Try this:

[PHP]select sequence
from table a
where not exists(select sequence from table where sequence = a.sequence + 1)[/PHP]

Good Luck.

Thank you. I will try that.
Apr 6 '07 #3

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

Similar topics

3
4073
by: special_agent69 | last post by:
Not sure if this is a stoopid question or not. If it is, my apologies. I'd like to have an ASP form performing a relatively simple calculation. For example, if I wanted to create a simple...
11
4108
by: Andy Fish | last post by:
Hi, I am trying to concoct a query that will join rows on the basis of a whitespace insensitive comparison. For instance if one row has the value 'a<space>b' and another has the value...
2
2126
by: M Wells | last post by:
Hi All, Just wondering if you perform an update using a where condition that actually returns no rows to be updated, does @@Error contain an error message afterwords? We want to fire an...
6
1591
by: Caveman | last post by:
-- I have a situation where doing -- first example -- 1. Get series of values througha query into a string (@val)like '1,2,3,4': declare @val varchar(4000) select @Val = @val + cast(myval as...
4
9360
by: sandip | last post by:
Hi, Can anyone tell me how to calculate the ctual disk space needed for a table? The record length and number of records are known. A rough estimate of the disk space would suffice. Please...
3
3504
by: laurentc via AccessMonster.com | last post by:
Hi. I have an issue with my Access project. I have rather big tables of data (about 11 000 rows). These tables are historical product quotations, so they are very simple : - MyDate...
0
1361
parshupooja
by: parshupooja | last post by:
Hi all, I need help. I am using asp.net C# . I have binded gridview with 5 columns. I have Dropdownlist in 4 columns Morning in, morning out, afternoon in and afternoon out and label in 5 column...
5
4559
by: jamesnkk | last post by:
I want to calculate the average price, I have a cost price table- tblcostPrice as below,Same part no can be purchase from different supplier at different cost. In my tblcostPrice I have 2...
8
5082
by: Sham | last post by:
I am trying to perform the following query on a table that has been indexed using Full Text Search. The table contains multiple columns than have been indexed. (Below, all xml columns are...
0
7044
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
6908
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
7045
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,...
0
7087
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...
1
6741
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
1
4782
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
2985
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1300
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 ...
1
563
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.