List:General Discussion« Previous MessageNext Message »
From:Yo Mismo Date:February 26 2007 1:41pm
Subject:problems with a select
View as plain text  
First at all, i`m spanish so please, apologize for my english
Hello to everybody, i`m a newby with mysql and i have a problem with a select
I`m making a database for a hostel
I have 2 tables for reservations, one is called rooms  and have 2 fields (id_room,
tipo)and the other one is ocupation with 3 colums(id_reservation, date and id_room)
I`m using innodb database
I insert a register on the ocupation table for each day of the reservations, with the
id_room and the id_reservation
I wanna mean, if u make a reservation for the 22-3-2007 to 24-3-2007 i will do that

  rooms table
id_reservation        date            id_room
     0001            2007-03-22        101
     0001            2007-03-23        101
     0001            2007-03-24        101

I know must there are a lot of better ways to do it, but i think is the simplest one
Now, my problem with the query is when i need to know for a especific date, witch rooms
are avaliable
I wanna mean, if i try to check for the 22-03-2007 the query must return me all the rooms
except the 101
Using SQL i can do it with a minus sentence, but the mysql version i`m using(5.0.24a) cant
support it
Have anyone any idea?
Thanks, and please, forgive my english
;)
Thread
problems with a selectYo Mismo26 Feb
  • Re: problems with a selectRaul Andres Duque26 Feb