Hi all,
I'm using two tables for handling a little room reservations system:

a rooms table:

CREATE TABLE `rooms` (
  `id` int(11) NOT NULL auto_increment,
  `room_number` int(3) default NULL,
  `room_type` char(1) default NULL,
  PRIMARY KEY  (`id`)
) TYPE=MyISAM;

a reservations table:

CREATE TABLE `reservations` (
  `id` int(11) NOT NULL auto_increment,
  `room_id` int(11) default NULL,
  `date_from` date default NULL,
  `date_to` date default NULL,
  PRIMARY KEY  (`id`)
) TYPE=MyISAM;

I have quite clear the join syntax (using for the the ON clause rooms.id and reservations.room_id fields ) to list all the rooms reserved on a given date interval, but I can't figure out the query to list all the rooms of a given type (room_type) that results FREE ( not reserved ) on the given date interval.

thanx for your help,

      Giulio


-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]



Reply via email to