Avatar of rwaterz
rwaterz
Flag for United States of America asked on

Finding pairs of seats

I need to perform a check to find out how many pairs of seats exist on a given performance. I can't do just a seat count because individual seats on opposite sides of the theatre are not desired. Here is a link to an image of the seat configuration and attached is a spreadsheet with the columns we have to work with:

https://securesite.lajollaplayhouse.org/_QA_/single/SYOS.aspx?p=9054

Note: The spreadsheet is the data related to the image provided.

I am having trouble figuring out a way to determine seats that are next to each other. Thanks for the help!
Capture.PNG
TX-PERF-SEAT.xlsx
Microsoft SQL Server 2008Databases

Avatar of undefined
Last Comment
rwaterz

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
ste5an

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
rwaterz

ASKER
Thanks for that, i'll do some testing and see how it works out.

Wouldn't islands be what I am looking for? Gaps would be the break between seats and islands would be the pair (or greater) of seats...right?
ste5an

This is just a definion question. Islands are normally existing numbers, gaps are missing numbers. I would name already reserved seats as islands.
rwaterz

ASKER
That is absolutely the solution!

I found this article: https://www.simple-talk.com/sql/t-sql-programming/the-sql-of-gaps-and-islands-in-sequences/ to be quite useful as well. I thought I'd share for others who may have a similar question. I would have never found that article without your help in identifying the type of solution I needed.

Thank you!
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy