Author Topic: Show all but these records...  (Read 384 times)

0 Members and 1 Guest are viewing this topic.

Offline xoligyTopic starter

  • Enthusiast
  • Posts: 237
    • View Profile
Show all but these records...
« on: March 14, 2010, 02:36:15 PM »
Ok i have tried a few variations of this code and all have come out the same it will show me the records of the selected numbers but i dont want that i want the ones not equal to them lol

So i want it to display all the records in misisons where miss_id (in comp) is not equal to id (in missions) thought it be simple but i just get a blank table lol

here is the funky code
Code: [Select]
"select missions.id, missions.mission,missions.location, missions.level, missions.loot, missions.energy, missions.energy1, missions.bronze, missions.silver, missions.gold, missions.platinum, comp.miss_id, comp.user_id, comp.completed from missions, comp where comp.user_id=1 and comp.miss_id=missions.id"

Offline xoligyTopic starter

  • Enthusiast
  • Posts: 237
    • View Profile
Re: Show all but these records...
« Reply #1 on: March 15, 2010, 03:09:52 PM »
Take it what i want isn't possible then :/

Offline ajlisowski

  • Enthusiast
  • Posts: 109
    • View Profile
Re: Show all but these records...
« Reply #2 on: March 15, 2010, 04:33:24 PM »
SELECT id, mission, level, location, loot FROM missions WHERE id NOT IN (SELECT miss_id FROM comp)

Offline xoligyTopic starter

  • Enthusiast
  • Posts: 237
    • View Profile
Re: Show all but these records...
« Reply #3 on: March 15, 2010, 05:09:38 PM »
Thanks for that ajlisowski! Never seen that done in a tut :)