Last active
May 13, 2016 22:21
-
-
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)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- 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