If anyone would use following select, then you get some funny stuff::

select *
FROM  Table1, Table2
WHERE  Table1.comp   = 1015
AND Table1.fileno  > 0
AND Table2.clientcode  *= Table1.clientcode
AND Table2.comp   *= Table1.comp
ORDER BY Table1.agency ASC, Table1.fileno DESC

I must admit, it's only when you join tables.

We want a list of agency in an ascending order and fileno > 0 in a
descending order.
Previous select gives the fileno < 0 instead of > 0.

---

So what you have to do is following:

select *
FROM  Table1, Table2
WHERE  Table1.comp   = 1015
AND Table1.fileno  < 0
AND Table2.clientcode  *= Table1.clientcode
AND Table2.comp   *= Table1.comp
ORDER BY Table1.agency ASC, Table1.fileno DESC

In this case you have to select fileno < 0 to get fileno > 0

Working with CQL = Cach� Query Language is a challenge.





Reply via email to