http://web2py.com/book/default/chapter/06?search=belong#belongs
Richard On Thu, Nov 3, 2011 at 2:35 PM, Omi Chiba <[email protected]> wrote: > 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) >

