Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Excluding Rows.
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Excluding Rows.

 Post Reply Post Reply
Author
davidshq View Drop Down
Senior Member
Senior Member


Joined: 29 July 2003
Location: United States
Status: Offline
Points: 299
Post Options Post Options   Thanks (0) Thanks(0)   Quote davidshq Quote  Post ReplyReply Direct Link To This Post Topic: Excluding Rows.
    Posted: 15 January 2006 at 5:22am
   I have a database of games at GameSecretary.Com. Some of these games are related, for example - Dr. Dodgeball, Regular Dodgeball, and Freeball.
   I also have a weekly game generator that selects the best games for your group to play. The problem is that right now it is sometimes generating related games (e.g., Dr. Dodgeball and Regular Dodgeball) and usually you want to avoid using two of the same type of games on the same night.
    So I decided to create a GameRelationships table. This table consists of a unique identifier, a GameID and a RelatedID. The first identifies the game we're talking about, the other identifies the game that is related to it. So it might look something like this:
1 - Dodgeball - Tag Dodgeball
    Except that everything is numeric (a unique key).
    Anyways, what I want to do is exclude results if they are related. Okay, thats simple. But what if I want to keep the first game that comes up that has a relation, but not any further games? For example, its fine for someone to have Dr. Dodgeball on their list of weekly games, I just don't want the script automatically generating Dr. Dodgeball and Freeball on the same list (or any other variation of dodgeball).
    I've searched everywhere and have spent several hours today trying to crack this problem, but haven't been able to figure it out.
    Right now I am attempting to put one result in a #results table. Then add additional rows. The idea being that I could create a insert statement that said (pseudo):
Insert into #results where the #results.GameRelated != the Game.ID.
     Basically, what all that says is "Add a row to the temporary table if the already existing games aren't related to this game, if they are related, try the next record."
     Of course if this all worked I wouldn't be posting here. Your thoughts and solutions would be appreciated.
David.
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.