I'm using DB2 and I can do the sql on AS400 like this. This is only selecting the data from SDTH2P01 which value is not existing in PDTFF.
SELECT * FROM SPDTHKU/SDTH2P01 WHERE H2DNO NOT IN (SELECT FFDNO FROM SPDTHKU/PDTFF) Can we do it on web2py and how ? My contoller --------------------------------------------------------- def index(): query = db.SDTH2P01.H2DNO<>'' orders=db(query).select(orderby=[db.SDTH2P01.H2JCSC,db.SDTH2P01.H2TRD1]) return dict(orders=orders)