473,507 Members | 2,472 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Returning Limited Sequential Rows

Greetings,

I've been working on a project for my church for a couple of weeks.
We're going to be selling tickets to our events and we need to look
for available seats in our hall.

I have a query that returns to me all the seats that are available,
which is great but the ideal solution would be to return X number of
seats based on a seatnum (Integer).

For example, if seats 10, 11, 12 and 15-20 are available and I need 4
of them, I should get back seats 15,16,17,18.

I'm pretty sure that some sort of IF statement with a variable in the
query is the answer, but I can't seem to push through on it.

NOTE: seatnum is NOT a primary key and is not autoincrement. An
autoincrement col wouldn't work for this project as the sections, rows
and seats might get edited as things change in the hall. So I'm doing
the seat numbering myself.

If anyone could give me shove in the right direction, I'd appreciate
it. After many Google searches for "sequential" rows or records and
the like, all I get are people wanting to return record counts.

Thanks much! I'm going to keep plugging away at it and if I figure it
out, I'll post it here.

RK
Jul 20 '05 #1
0 1526

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

Similar topics

1
2833
by: Ira | last post by:
I'm on a hosted Linux server and I have an Outer Join query that's returning on one less row than I expect. There are two rows very similar and I expect them both returned. There are similar...
3
1690
by: Mike | last post by:
I have a view that will return say 5000 records when I do a simple select query on that view like. select * from vw_test_view How can I set up my query to only return a certain # of...
3
2026
by: Kevin Macdonald | last post by:
I expected Postgresql to use an indexed access method, but in certain cases it is using a sequential scan. Details are below: Table: P1_NRN_ROAD ( sobjid int8 primary key, v int8...
4
1815
by: Henry Combrinck | last post by:
Hello Searched around, but could not find this mentioned. I've noticed the following behaviour in 7.4.5: select * from foo where col1 = 1 or col1 = 2 or col1 = 3 or
4
4252
by: JeremiahOSullivan | last post by:
Hi, I have a sql server database with 1.7 million records in a table, with about 30 fields When I run select * from tablename it can take over 5 minutes. How can I get this time down or is...
19
4142
by: eric.nave | last post by:
this is a slight change to a fequently asked question around here. I have a table which contains a "sortorder" column where a user can specify some arbitrary order for records to be displayed in. ...
0
1573
by: Serman D. | last post by:
Hi, I am trying to implement an MD5 checksum function using an UDF call to C wrapper returning the MD5 checksum. I've downloaded a free (LGPL) implementation in C of the MD5 algorithm from...
13
2534
by: Karl Groves | last post by:
I'm missing something very obvious, but it is getting late and I've stared at it too long. TIA for responses I am writing a basic function (listed at the bottom of this post) that returns...
3
4340
by: codefragment | last post by:
Hi I have a chunky bit of sql that I will want to call from a number of places. It will return a few thousand rows. Whats the best way of structuring this? 1) I initially thought of using...
0
7321
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
7377
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...
0
7488
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5623
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,...
1
5045
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
4702
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...
0
3191
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1544
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 ...
0
412
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...

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.