SonicBase. In-memory embedded or distributed streaming sql database

SQL Select With Limit Statement

Limits the number of results to return


SELECT select_columns FROM table_name LIMIT count
count:  number of results to limit the query to


PreparedStatement stmt = conn.prepareStatement("select * from persons where id < ? and id > ? limit 3");
stmt.setLong(1, 100);
stmt.setLong(2, 2);
ResultSet ret = stmt.executeQuery();