sql - MySQL Compare start and finish time -



sql - MySQL Compare start and finish time -

i trying create booking system, mysql table has row

class="lang-none prettyprint-override">room id | start (datetime) | | finish(datetime) 13 2014-10-20 08:30 | 2014-10-20 18:30

and want block entries between these start , finish

class="lang-none prettyprint-override">eg: room id: 13 start: 2014-10-20 10:30 finish: 2014-10-20 12:30

to have wrote mysql query, is sql correct?

class="lang-sql prettyprint-override">select * rooms room_id='13' , ('2014-10-20 12:30:00' <= start_time or '2014-10-20 10:30:00'>=finish_time)

in here tried skip between result, please advise me.

you want between start time , finish time means didn't test 1 time can seek this..i hope works

select * rooms room_id='13' , ('2014-10-20 12:30:00' >= start_time , '2014-10-20 10:30:00'<=finish_time)

mysql sql

Comments

Popular posts from this blog

Delphi change the assembly code of a running process -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -

C++ 11 "class" keyword -