Excuse me if I am misunderstanding your problem but this SQL query seems
quite a bit strange to me why isn't it...
Select ROWNUM, vendor_code From lot_set where ROWNUM>10 AND ROWNUM<20
Order BY ROWNUM
And if this is the goal, then you have to use the criterion object
because you are referencing the same column twice in one query...
This is copied from the criteria how to:
Criteria criteria = new Criteria();
criteria.add(InvoicePeer.COST, 1000, Criteria.GREATER_EQUAL);
Criteria.Criterion criterion = criteria.getCriterion(InvoicePeer.COST);
criterion.and(
criteria.getNewCriterion(
criterion.getTable(),
criterion.getColumn(),
new Integer(5000),
Criteria.LESS_EQUAL )
);
Hope this helps
Cameron
-----Original Message-----
From: John Varghese [mailto:[EMAIL PROTECTED]
Sent: Saturday, January 31, 2004 3:36 PM
To: [EMAIL PROTECTED]
Subject: A complex SQL query
Hi,
How to write this using torque
SQL> select ROWNUM , vendor_code from (select * from lot_set order by
vendor_code) where
ROWNUM <20
2 minus
3 select ROWNUM , vendor_code from (select * from lot_set order by
vendor_code) where
ROWNUM <10;
ROWNUM VENDOR_COD
---------- ----------
10 0000004127
11 padmin
12 padmin
13 padmin
14 padmin
15 padmin
16 padmin
17 padmin
18 padmin
19 padmin
Pls help
Bye
John
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]