Skip to content

Instantly share code, notes, and snippets.

@alexanderjsingleton
Last active May 13, 2016 22:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alexanderjsingleton/03aa4e2d6e2f522717d95d7b3fcd80fa to your computer and use it in GitHub Desktop.
Save alexanderjsingleton/03aa4e2d6e2f522717d95d7b3fcd80fa to your computer and use it in GitHub Desktop.
A simple Oracle PL/SQL statement provided for [my blog-post on databases](https://www.alexanderjsingleton.com/event-horizon-data-centric-future)
-- An Oracle PL/SQL example for my blog-post:
CONNECT ap/ap;
SET SERVEROUTPUT ON
declare
min_invoice_total ap.invoices.invoice_total%TYPE;
max_invoice_total ap.invoices.invoice_total%TYPE;
begin
SELECT MIN(invoice_total), MAX(invoice_total) INTO min_invoice_total,max_invoice_total
FROM ap.invoices;
DBMS_OUTPUT.put_line(REGEXP_REPLACE('The minimum invoice total is' ||
to_char(min_invoice_total, '$999,999.00') ||
' while the maximum output total is ' ||
to_char(max_invoice_total, '$999,999.00') || '.', ' +', ' '));
end;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment