Derby支持fetch子句,不支持limit子句,SQLUtils.toSQLString会将fetch输出为limit
Druid版本: 1.1.21
测试用例:
String dbType = JdbcConstants.DERBY;
String sql = "select * from mytest FETCH FIRST 200 ROWS ONLY";
List<SQLStatement> statements = SQLUtils.parseStatements(sql, dbType);
FormatOption DEFAULT_FORMAT_OPTION = new FormatOption(false, false, false);
for(SQLStatement statement : statements) {
String result = SQLUtils.toSQLString(statement, dbType, DEFAULT_FORMAT_OPTION);
// 输出结果为: sql: select * from mytest limit 200
System.out.println("sql: " + result);
}
暂无答案!
目前还没有任何答案,快来回答吧!