SELECT <> FROM
WHERE
GROUP BY
HAVING
ORDER BY
EXAMPLE:
SELECT P_OID,BASE_CR_FAC_ID,COUNT(*) FROM
V_A_FAC_P_ITEM
WHERE PROPOSAL_ITEM_APPR_STATUS_CODE = 'discarded'
GROUP BY BASE_C_FAC_ID,P_OID
HAVING COUNT(*) >1
ORDER BY P_OID desc
Further Reading: http://www.java2s.com/Code/SQL/Select-Clause/UsingmathfunctioninHAVING.htm
- SQL ROCKS..!!!
No comments:
Post a Comment