0 Replies Latest reply: Aug 25, 2014 12:43 PM by Rayna Curtis RSS

    Excluding records with the script

    Rayna Curtis

      I am annoyed with myself for having to ask this, because I am sure it's a simple thing but I can't seem to get it to work.

       

      In my company's database, you can have bookings with no rooms and rooms with no bookings.  This view centres entirely on bookings (both with and without rooms) and I want to make sure the rooms without bookings don't show up at all.

       

      So I load the booking table, and then with the rooms table, my statement is this:

       

      SQL SELECT *

      FROM $(TBLPRE)rooms u JOIN $(TBLPRE)bookings b on

      u.group_reservation=b.reservation_number where b.reservation_number>0 ;

       

      I also tried

       

      SQL SELECT *

      FROM $(TBLPRE)rooms u RIGHT OUTER JOIN $(TBLPRE)bookings b on

      u.group_reservation=b.reservation_number where b.reservation_number>0 ;


      What am I missing?