Finding pairs of seats

rwaterz
rwaterz used Ask the Experts™
on
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
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

Author

Commented:
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?
ste5anSenior Developer

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

Author

Commented:
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!

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial