I need to know how many records were returned in a select in oracle. Currently, I do two queries:
SELECT COUNT(ITEM_ID) FROM MY_ITEMS; SELECT * FROM MY_ITEMS;
This ought to do the trick.
WITH base AS ( SELECT * FROM MY_ITEMS ) SELECT (SELECT COUNT(*) FROM base) kount, base.* FROM base