Thursday, December 20, 2007

Applying the having clause

Applying the having clause
---------------------------AVOID-------------------------

SELECT carrid
connid
fldate
MAX( luggweight )
INTO (xcarrid, xconnid, xfldate, max)
FROM sbook
GROUP BY carrid connid fldate.

CHECK max > 20.
WRITE: / xcarrid,
xconnid,
xfldate,
max.

ENDSELECT.

---------------------------USE-------------------------

SELECT carrid
connid
fldate
MAX( luggweight )
INTO (xcarrid, xconnid, xfldate, max)
FROM sbook
GROUP BY carrid connid fldate
HAVING MAX( luggweight ) > 20.

WRITE: / xcarrid,
xconnid,
xfldate,
max.

ENDSELECT.

No comments:

Blog Archive