Simple SQL Question

Das Goravani goravanis at gmail.com
Wed Oct 26 19:44:34 UTC 2022


I have tried to look this up, scoured others existing code, to no avail

How do you 

Select the highest Primary Key value
With a couple other columns
Where it’s for a certain customer, and "current" is true

I have this so far:

SELECT max(CC_SEQ),CC_CREDIT_NUM,CC_TOKEN 
FROM cust_cc 
WHERE CC_CCODE=@[iRowCust.CCODE] 
AND CC_CURRENT=1

It’s not working, doing it in an exec direct using the statement object

It’s returning no rows when I know there is one that matches


More information about the omnisdev-en mailing list