General information
Category:
Databases,Tables, Views, Indexing and SQL syntax
Hi John,
cid primary FOR inmates
cinmates_id,ttxndatetm primary FOR acct_events
SELECT cinmates_id,MAX(ttxndatetm) ttxndatetm FROM acct_events WHERE txnstatus = "OPEN" GROUP BY 1 INTO CURSOR tDummy
SELECT A.* FROM FORCE tDummy B JOIN acct_events A JOIN ;
ON A.cinmates_id = B.cinmates_id AND A.ttxndatetm = B.ttxndatetm;
INTO CURSOR tDummy
SELECT * FROM inmates JOIN tDummy;
ON inmates.cid = tDummy.cinmates_id;
INTO CURSOR WHAT_YOU_WANTED
Uses:
Index
SCAN
SEEK
you can get WHAT_YOU_WANTED much more fastly
Fabio
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only