tags:

views:

80

answers:

1

I want a sql query to insert the available slots into a table (avail) from booked slots table.

I have two tables .I have a book table with bookstarttime and bookendtime columns .these are timestamp objects.I have another table with availstarttime and availendtime.these are also timestamp columns.I have to get the available slots left between these booked slots.I will enter the starttime and endtime from a form .Then I want a sql query to get the availble slots between the values of starttime and endtime

I am using database:apache derby

+1  A: 

You may want to check the very similar question listed below.

Also, as Tomalak said, you almost certainly don't want to keep two copies of the same data in your database. Maybe add a view which gives you a view of the data from the other perspective, but don't keep two copies of the same information because it will almost certainly become conflicted.

Similar question: Finding free slots in a booking system

Tom H.
+1 for finding a suitable related question. Unless the OP's intentions become more clear, a vague answer is the best he can hope for anyway.
Tomalak