Field<RowId> rowid = myTable.rowid();

Condition condition = rowid.between(new SQLiteRowId(1), new SQLiteRowId(5));
Field<?>[] fields = myTable.fields();
List<Field<?>> baseFields = Arrays.asList(fields);
List<Field<?>> theFields = new ArrayList<>();
theFields.add(myTable.rowid());
theFields.addAll(baseFields);

Result<Record> records = 
dsl.select(theFields).from(myTable).where(condition).fetch();
System.out.println(records);
String sql = "select rowid, C1, C2, C3, c4, c5 from testFile_Data where 
rowid between 1 and 5";
Result<Record> records1 = dsl.resultQuery(sql).fetch();
System.out.println(records1);

+--------------------------------+------------------+------------------+------------------+------+------------------+
|rowid                           |                C1|                
C2|                C3|c4    |                c5|
+--------------------------------+------------------+------------------+------------------+------+------------------+
|org.jooq.impl.RowIdImpl@2d83c5a5|10.608312205708812|11.819563953229215|12.66794218385106
 
|Manuel| 8.79958146171531 |
|org.jooq.impl.RowIdImpl@48d7ad8b|12.357092448543806| 
9.736640688345172|10.797461508490033|Manuel| 9.56435040519036 |
|org.jooq.impl.RowIdImpl@7e053511| 9.351088769471737| 9.738166693505423| 
9.737137720605116|Manuel|11.14597662621474 |
|org.jooq.impl.RowIdImpl@60222fd8| 9.094163074400619| 9.88912380402126 
|12.003215484119126|Manuel| 9.22592986379638 |
|org.jooq.impl.RowIdImpl@53bf7094| 9.837869522611827| 
9.200597390149854|10.085601693639953|Manuel|10.466740361406583|
+--------------------------------+------------------+------------------+------------------+------+------------------+

+-----+------------------+------------------+------------------+------+------------------+
|rowid|                C1|                C2|                C3|c4    
|                c5|
+-----+------------------+------------------+------------------+------+------------------+
|    1|10.608312205708812|11.819563953229215|12.66794218385106 |Manuel| 
8.79958146171531 |
|    2|12.357092448543806| 9.736640688345172|10.797461508490033|Manuel| 
9.56435040519036 |
|    3| 9.351088769471737| 9.738166693505423| 
9.737137720605116|Manuel|11.14597662621474 |
|    4| 9.094163074400619| 9.88912380402126 |12.003215484119126|Manuel| 
9.22592986379638 |
|    5| 9.837869522611827| 
9.200597390149854|10.085601693639953|Manuel|10.466740361406583|
+-----+------------------+------------------+------------------+------+------------------+

It seems to me that these two queries should produce the same text output.

Perhaps this should be submitted as an issue. Or, I'm missing something.

-- 
You received this message because you are subscribed to the Google Groups "jOOQ 
User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jooq-user/273e0daf-a254-49aa-b86c-4eb1639402e4n%40googlegroups.com.

Reply via email to