Use a basic INNER JOIN
to achieve that.
SELECT b.*
FROM booking b INNER JOIN room r USING(RoomID)
WHERE @date_input BETWEEN startdate AND enddate AND size = @size_input;
Change @date_input
and @size_input
to your real input.
More Related Contents:
- Hours and seconds are lost when storing a date in the database [closed]
- Multiple queries executed in java in single statement
- MySQL and JDBC with rewriteBatchedStatements=true
- “EEE MMM dd HH:mm:ss ZZZ yyyy” date format to java.sql.Date
- right syntax to use near ‘?’
- Running a .sql script using MySQL with JDBC
- Prevent SQL injection attacks in a Java program
- LINQ for Java tool [closed]
- java.sql.SQLException: No suitable driver found for jdbc:mysql://localhost:3306/dbname [duplicate]
- How to use prepared statement for select query in Java?
- A datetime equivalent in java.sql ? (is there a java.sql.datetime ?)
- Hibernate Criteria API: get n random rows
- Getting last record from mysql
- MySQL query to get Records in Result set
- How to get UTF-8 working in Java webapps?
- How do I get the size of a java.sql.ResultSet?
- What is the best approach using JDBC for parameterizing an IN clause? [duplicate]
- How to configure Tomcat to connect with MySQL
- com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure Software caused connection abort: recv failed [duplicate]
- dll missing in JDBC
- Is there a way to run MySQL in-memory for JUnit test cases?
- Inserting null to an Integer column using JDBC
- How to implement a SQL like ‘LIKE’ operator in java?
- java.sql.SQLException: Before start of result set [duplicate]
- Table ‘DBNAME.hibernate_sequence’ doesn’t exist
- How to setup Hibernate to read/write to different datasources?
- JDBC MySQL connection using Unix Socket
- Unable to get multiple Table entities through Stored procedure using hibernate
- JDBC connection error : unrecognized timezone [duplicate]
- Searching between dates in SQL with JDBC?